All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle Huey <me@kylehuey.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] Fix compat regression in process_vm_rw()
Date: Mon, 26 Oct 2020 17:47:45 -0700	[thread overview]
Message-ID: <CAP045Ao+uJAj6CEqaJ3Qxi1ma2frio7UEURJ63ua2yTruvv+pA@mail.gmail.com> (raw)
In-Reply-To: <f69575e0-5170-2d51-8d74-8b3453723aa3@kernel.dk>

On Mon, Oct 26, 2020 at 5:03 PM Jens Axboe <axboe@kernel.dk> wrote:
>
> The removal of compat_process_vm_{readv,writev} didn't change
> process_vm_rw(), which always assumes it's not doing a compat syscall.
> Instead of passing in 'false' unconditionally for 'compat', make it
> conditional on in_compat_syscall().
>
> Fixes: c3973b401ef2 ("mm: remove compat_process_vm_{readv,writev}")
> Reported-by: Kyle Huey <me@kylehuey.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>
> ---
>
> diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
> index fd12da80b6f2..05676722d9cd 100644
> --- a/mm/process_vm_access.c
> +++ b/mm/process_vm_access.c
> @@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid,
>                 return rc;
>         if (!iov_iter_count(&iter))
>                 goto free_iov_l;
> -       iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, false);
> +       iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r,
> +                               in_compat_syscall());
>         if (IS_ERR(iov_r)) {
>                 rc = PTR_ERR(iov_r);
>                 goto free_iov_l;
>
> --
> Jens Axboe
>

I tested this patch and it does fix the original testcase I reported.

- Kyle

  parent reply	other threads:[~2020-10-27  0:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27  0:03 [PATCH] Fix compat regression in process_vm_rw() Jens Axboe
2020-10-27  0:09 ` Al Viro
2020-10-27  8:01   ` Christoph Hellwig
2020-10-27 17:00     ` Linus Torvalds
2020-10-27  0:47 ` Kyle Huey [this message]
2020-10-27  8:00 ` Christoph Hellwig
2020-10-27 19:19 ` damian
2020-10-27 19:27   ` Naresh Kamboju
2020-10-27 19:32   ` Jens Axboe

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=CAP045Ao+uJAj6CEqaJ3Qxi1ma2frio7UEURJ63ua2yTruvv+pA@mail.gmail.com \
    --to=me@kylehuey.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.