lkml.org 
[lkml]   [2017]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: perf: use-after-free in perf_release
    On 03/16, Peter Zijlstra wrote:
    >
    > On Wed, Mar 15, 2017 at 05:43:02PM +0100, Oleg Nesterov wrote:
    > > static inline int list_is_first(const struct list_head *list,
    > > const struct list_head *head)
    > > {
    > > return head->next == list;
    > > }
    > >
    > > won't be symmetrical with list_is_last() we already have.
    >
    > This is the one that makes sense to me though; that is, the current
    > list_is_last() doesn't make sense to me.
    >
    > I would expect:
    >
    > static inline int list_is_last(const struct list_head *list,
    > const struct list_head *head)
    > {
    > return head->prev == list
    > }

    Yes!

    > because @head is the list argument (yes, I know, horrible naming!).

    and perhaps it could have more users if we redefine it to dereference
    "head" which is likely more "stable", iow less likely can go away.

    But after the quick grep I came to conclusion it is not possible to
    audit the users it already has.

    Oleg.

    \
     
     \ /
      Last update: 2017-03-16 17:44    [W:4.994 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site