Re: [PATCH 4/9] aio: sanitize ki_list handling

2018-03-22 Thread Christoph Hellwig
On Thu, Mar 22, 2018 at 03:24:14PM +, Al Viro wrote: > On Wed, Mar 21, 2018 at 08:32:27AM +0100, Christoph Hellwig wrote: > > > - if (iocb->ki_list.next) { > > + if (!list_empty_careful(iocb->ki_list.next)) { > > Umm... Why not list_empty_careful(&iocb->ki_list)? Yes, that makes a lot m

Re: [PATCH 4/9] aio: sanitize ki_list handling

2018-03-22 Thread Al Viro
On Wed, Mar 21, 2018 at 08:32:27AM +0100, Christoph Hellwig wrote: > - if (iocb->ki_list.next) { > + if (!list_empty_careful(iocb->ki_list.next)) { Umm... Why not list_empty_careful(&iocb->ki_list)?

Re: [PATCH 4/9] aio: sanitize ki_list handling

2018-03-21 Thread Greg KH
On Wed, Mar 21, 2018 at 08:32:27AM +0100, Christoph Hellwig wrote: > Instead of handcoded non-null checks always initialize ki_list to an > empty list and use list_empty / list_empty_careful on it. While we're > at it also error out on a double call to kiocb_set_cancel_fn instead > of ignoring it.

[PATCH 4/9] aio: sanitize ki_list handling

2018-03-21 Thread Christoph Hellwig
Instead of handcoded non-null checks always initialize ki_list to an empty list and use list_empty / list_empty_careful on it. While we're at it also error out on a double call to kiocb_set_cancel_fn instead of ignoring it. Signed-off-by: Christoph Hellwig Acked-by: Jeff Moyer Reviewed-by: Darr