lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [syzbot] KASAN: null-ptr-deref Read in __free_pages
    Date
    Fabio M. De Francesco <fmdefrancesco@gmail.com> wrote:

    > I cannot have any objection, it's up to you to decide :)

    Of course you can object. That's kind of the point of a review;-)

    How about the attached instead, then?

    David
    ---
    --- a/kernel/watch_queue.c
    +++ b/kernel/watch_queue.c
    @@ -271,9 +271,8 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
    return 0;

    error_p:
    - for (i = 0; i < nr_pages; i++)
    - if (pages[i])
    - __free_page(pages[i]);
    + while (--i >= 0)
    + __free_page(pages[i]);
    kfree(pages);
    error:
    (void) account_pipe_buffers(pipe->user, nr_pages, pipe->nr_accounted);
    \
     
     \ /
      Last update: 2022-03-21 10:38    [W:2.968 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site