[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180409.105839.445341256424332032.davem@davemloft.net>
Date: Mon, 09 Apr 2018 10:58:39 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net] inetpeer: fix uninit-value in inet_getpeer
From: Eric Dumazet <edumazet@...gle.com>
Date: Mon, 9 Apr 2018 06:43:27 -0700
> syzbot/KMSAN reported that p->dtime was read while it was
> not yet initialized in :
>
> delta = (__u32)jiffies - p->dtime;
> if (delta < ttl || !refcount_dec_if_one(&p->refcnt))
> gc_stack[i] = NULL;
>
> This is a false positive, because the inetpeer wont be erased
> from rb-tree if the refcount_dec_if_one(&p->refcnt) does not
> succeed. And this wont happen before first inet_putpeer() call
> for this inetpeer has been done, and ->dtime field is written
> exactly before the refcount_dec_and_test(&p->refcnt).
>
> The KMSAN report was :
...
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: syzbot <syzkaller@...glegroups.com>
Applied, but it looks like we are just adding assignments simply
to placate these reports when the tools and facilities cannot
see through the logic properly.
Powered by blists - more mailing lists