From: Greg KH <gregkh@linuxfoundation.org>
To: Miles Chen <miles.chen@mediatek.com>
Cc: stable@vger.kernel.org
Subject: Re: Suggest make 'user_access_begin()' do 'access_ok()' to stable kernel
Date: Thu, 11 Jun 2020 13:15:06 +0200 [thread overview]
Message-ID: <20200611111506.GE3802953@kroah.com> (raw)
In-Reply-To: <1591839462.26208.24.camel@mtkswgap22>
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,
greg k-h
next prev parent reply other threads:[~2020-06-11 11:15 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 [this message]
2020-06-12 1:33 ` Miles Chen
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=20200611111506.GE3802953@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=miles.chen@mediatek.com \
--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 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.