All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Bill Metzenthen <billm@melbpc.org.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86: math-emu: check __copy_from_user result
Date: Wed, 2 Oct 2019 23:26:02 -0700	[thread overview]
Message-ID: <201910022325.D6769F3@keescook> (raw)
In-Reply-To: <CAK8P3a2BKyz8Myrd-ob9t5FyJmQ_FVUmNMYbfzr6YUZWfyH4XQ@mail.gmail.com>

On Wed, Oct 02, 2019 at 09:11:23AM +0200, Arnd Bergmann wrote:
> On Wed, Oct 2, 2019 at 1:39 AM Kees Cook <keescook@chromium.org> wrote:
> 
> > > diff --git a/arch/x86/math-emu/reg_ld_str.c b/arch/x86/math-emu/reg_ld_str.c
> > > index f3779743d15e..fe6246ff9887 100644
> > > --- a/arch/x86/math-emu/reg_ld_str.c
> > > +++ b/arch/x86/math-emu/reg_ld_str.c
> > > @@ -85,7 +85,7 @@ int FPU_load_extended(long double __user *s, int stnr)
> > >
> > >       RE_ENTRANT_CHECK_OFF;
> > >       FPU_access_ok(s, 10);
> > > -     __copy_from_user(sti_ptr, s, 10);
> > > +     FPU_copy_from_user(sti_ptr, s, 10);
> >
> > These access_ok() checks seem redundant everywhere in this file (after
> > your switch from __copy* to copy*. I mean, I guess, just leave them, but
> > *shrug*
> 
> There have always been duplicate/inconsistent for the get_user/put_user
> case. I considered cleaning it all up but then decided to touch it as little
> as possible.

Yeah, at this point, I'd agree. :)

-- 
Kees Cook

  reply	other threads:[~2019-10-03  6:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 14:23 [PATCH 1/2] x86: math-emu: check __copy_from_user result Arnd Bergmann
2019-10-01 14:23 ` [PATCH 2/2] x86: math-emu: limit MATH_EMULATION to 486SX compatibles Arnd Bergmann
2019-10-01 21:54   ` Kees Cook
2019-10-03  9:33   ` [tip: x86/cpu] x86/math-emu: Limit " tip-bot2 for Arnd Bergmann
2019-10-01 23:39 ` [PATCH 1/2] x86: math-emu: check __copy_from_user result Kees Cook
2019-10-02  7:11   ` Arnd Bergmann
2019-10-03  6:26     ` Kees Cook [this message]
2019-10-03  9:33 ` [tip: x86/cpu] x86/math-emu: Check __copy_from_user() result tip-bot2 for Arnd Bergmann

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=201910022325.D6769F3@keescook \
    --to=keescook@chromium.org \
    --cc=arnd@arndb.de \
    --cc=billm@melbpc.org.au \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.