lkml.org 
[lkml]   [2021]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 097/199] iov_iter: fix the uaccess area in copy_compat_iovec_from_user
    Date
    From: Christoph Hellwig <hch@lst.de>

    [ Upstream commit a959a9782fa87669feeed095ced5d78181a7c02d ]

    sizeof needs to be called on the compat pointer, not the native one.

    Fixes: 89cd35c58bc2 ("iov_iter: transparently handle compat iovecs in import_iovec")
    Reported-by: David Laight <David.Laight@ACULAB.COM>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    lib/iov_iter.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/lib/iov_iter.c b/lib/iov_iter.c
    index 1635111c5bd2a..a21e6a5792c5a 100644
    --- a/lib/iov_iter.c
    +++ b/lib/iov_iter.c
    @@ -1658,7 +1658,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov,
    (const struct compat_iovec __user *)uvec;
    int ret = -EFAULT, i;

    - if (!user_access_begin(uvec, nr_segs * sizeof(*uvec)))
    + if (!user_access_begin(uiov, nr_segs * sizeof(*uiov)))
    return -EFAULT;

    for (i = 0; i < nr_segs; i++) {
    --
    2.27.0


    \
     
     \ /
      Last update: 2021-01-26 10:51    [W:4.042 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site