lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 1/4] binder: fix handling of error during copy
    On Tue, Nov 30, 2021 at 10:51:49AM -0800, Todd Kjos wrote:
    > If a memory copy function fails to copy the whole buffer,
    > a positive integar with the remaining bytes is returned.
    > In binder_translate_fd_array() this can result in an fd being
    > skipped due to the failed copy, but the loop continues
    > processing fds since the early return condition expects a
    > negative integer on error.
    >
    > Fix by returning "ret > 0 ? -EINVAL : ret" to handle this case.
    >
    > Fixes: bb4a2e48d510 ("binder: return errors from buffer copy functions")
    > Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
    > Signed-off-by: Todd Kjos <tkjos@google.com>
    > ---

    Looks good.
    Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

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