Re: [bug report] io_uring: add support for sqe links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 27, 2019 at 08:34:18AM -0600, Jens Axboe wrote:
> On 5/27/19 8:10 AM, Dan Carpenter wrote:
> > On Mon, May 27, 2019 at 07:36:22AM -0600, Jens Axboe wrote:
> >> On 5/27/19 4:08 AM, Dan Carpenter wrote:
> >>> Hello Jens Axboe,
> >>>
> >>> The patch f3fafe4103bd: "io_uring: add support for sqe links" from
> >>> May 10, 2019, leads to the following static checker warning:
> >>>
> >>> 	fs/io_uring.c:623 io_req_link_next()
> >>> 	error: potential NULL dereference 'nxt'.
> >>>
> >>> fs/io_uring.c
> >>>      614  static void io_req_link_next(struct io_kiocb *req)
> >>>      615  {
> >>>      616          struct io_kiocb *nxt;
> >>>      617
> >>>      618          nxt = list_first_entry_or_null(&req->link_list, struct io_kiocb, list);
> >                                                      ^^^^^^^^^^^^^^^
> > If this list is empty then "nxt" is NULL.
> 
> Right...
> 
> >>>      619          list_del(&nxt->list);
> >>>                             ^^^^^^^^^
> >>> The warning is a false positive but this is a NULL dereference.
> >>>
> >>>      620          if (!list_empty(&req->link_list)) {
> >                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> > We're checking for list_empty() here.
> 
> After deleting an entry from it.
> 

Ah...  Right.  Sorry.

regards,
dan carpenter




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux