Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Miles Chen <miles.chen@mediatek.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Subject: Re: Suggest make 'user_access_begin()' do 'access_ok()' to stable kernel
Date: Fri, 12 Jun 2020 09:33:10 +0800	[thread overview]
Message-ID: <1591925590.8494.1.camel@mtkswgap22> (raw)
In-Reply-To: <20200611111506.GE3802953@kroah.com>

On Thu, 2020-06-11 at 13:15 +0200, Greg KH wrote:
> On Thu, Jun 11, 2020 at 09:37:42AM +0800, Miles Chen wrote:
> > @@ -2601,7 +2603,17 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
> >  		unsigned int i;
> >  
> >  		/* Copy the new buffer offsets back to the user's exec list. */
> > -		user_access_begin();
> > +		/*
> > +		 * Note: count * sizeof(*user_exec_list) does not overflow,
> > +		 * because we checked 'count' in check_buffer_count().
> > +		 *
> > +		 * And this range already got effectively checked earlier
> > +		 * when we did the "copy_from_user()" above.
> > +		 */
> > +		if (!user_access_begin(VERIFY_WRITE, user_exec_list,
> > +				       count * sizeof(*user_exec_list)))
> > +			goto end_user;
> > +
> >  		for (i = 0; i < args->buffer_count; i++) {
> >  			if (!(exec2_list[i].offset & UPDATE))
> >  				continue;
> 
> No one seems to have test-built this code, it fails here on the 4.14.y
> kernel  :(
> 
> I'll go fix it up, but please, always at the very least, test build your
> patches before sending them out...
> 
> thanks,

Sorry for the breakage. It won't happen next time.

cheers,
Miles

> 
> greg k-h


      reply	other threads:[~2020-06-12  1:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 17:58 Suggest make 'user_access_begin()' do 'access_ok()' to stable kernel Miles Chen
2020-06-10 18:02 ` Greg KH
2020-06-11  1:37   ` Miles Chen
2020-06-11 10:56     ` Greg KH
2020-06-11 11:15     ` Greg KH
2020-06-12  1:33       ` Miles Chen [this message]

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=1591925590.8494.1.camel@mtkswgap22 \
    --to=miles.chen@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox