mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Yu\, Yu-cheng" <yu-cheng.yu@intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	syzbot <syzbot+2067e764dbcd10721e2e@syzkaller.appspotmail.com>,
	bp@alien8.de, bp@suse.de, dave.hansen@linux.intel.com,
	fenghua.yu@intel.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	peterz@infradead.org, syzkaller-bugs@googlegroups.com,
	tony.luck@intel.com, x86@kernel.org
Subject: Re: [syzbot] WARNING in ex_handler_fprestore
Date: Thu, 27 May 2021 21:17:02 +0200	[thread overview]
Message-ID: <871r9s7zrl.ffs@nanos.tec.linutronix.de> (raw)
In-Reply-To: <b2dddfbc-02cd-fcd8-6c89-ae6204e4cf6f@intel.com>

On Thu, May 27 2021 at 11:59, Yu-cheng Yu wrote:
> On 5/27/2021 9:49 AM, Thomas Gleixner wrote:
>> On Thu, May 27 2021 at 00:03, Thomas Gleixner wrote:
>>> I decoded it fully by now and will send out coherent info (and hopefully
>>> a patch) tomorrow with brain awake. Time for bed here...
>> 
>> Not yet there with a patch, but I have a trivial C reproducer. See
>> below.
>> 
>> The failure mode is:
>> 
>>      signal to task
>>        sigaction_handler()
>>          wreckage xsave.header.reserved[0]
>>          sig_return()
>>            restore_fpu_from_sigframe()
>>              try: XRSTOR from user -> #GP
>>              copy_from_user(fpstate, task->fpu.state.xsave);
>>              validate(task->fpu.state.xsave) -> fail
>>              fpu__clear_user_states()
>>                reinits FPU hardware but task state is still wreckaged
>
> In fpu__clear_user_states(), maybe can we clear xstate_header.reserved[] 
> as well?

Just because my reproducer wreckages xstate_header.reserved, you think
it's sufficient to maybe clear that field? May I recommend to study the
XSAVE documentation?

> Or do we want to check the user buffer first before copy it?

Before your patch the code was correct. So maybe study the SDM, the code
and the commit and carefully read this email plus the following ones
before you come up with more helpful suggestions.

<SNIP>
     80 lines of useless quotes
</SNIP>

See: https://people.kernel.org/tglx/notes-about-netiquette

Thanks,

        tglx

  reply	other threads:[~2021-05-27 19:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  8:51 syzbot
2021-05-26  0:33 ` Andy Lutomirski
2021-05-26  7:00   ` Dmitry Vyukov
2021-05-26 21:21     ` Yu, Yu-cheng
2021-05-26 22:37       ` Andy Lutomirski
2021-05-26 22:03   ` Thomas Gleixner
2021-05-27 16:49     ` Thomas Gleixner
2021-05-27 18:59       ` Yu, Yu-cheng
2021-05-27 19:17         ` Thomas Gleixner [this message]
2021-05-27 19:05       ` Thomas Gleixner
2021-05-31 17:46 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871r9s7zrl.ffs@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=syzbot+2067e764dbcd10721e2e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yu-cheng.yu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome