[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <457894.1682352358@warthog.procyon.org.uk>
Date: Mon, 24 Apr 2023 17:05:58 +0100
From: David Howells <dhowells@...hat.com>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: dhowells@...hat.com,
syzbot <syzbot+ebc945fdb4acd72cba78@...kaller.appspotmail.com>,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
linux-afs@...ts.infradead.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, marc.dionne@...istor.com,
netdev@...r.kernel.org, pabeni@...hat.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [afs?] [net?] KCSAN: data-race in rxrpc_send_data / rxrpc_set_call_completion
Dmitry Vyukov <dvyukov@...gle.com> wrote:
> If I am reading this correctly, rxrpc_send_data() can read wrong
> call->completion and state and incorrectly exit with an error if
> rxrpc_wait_to_be_connected() exists early right after observing error
> set here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/rxrpc/sendmsg.c?id=148341f0a2f53b5e8808d093333d85170586a15d#n58
> The code seems to assume that at that point all writes done by
> rxrpc_set_call_completion() are already finished, but it's not
> necessarily the case.
I'm not sure it matters. call->error can only be set by the I/O thread and
only if a call fails - in which case the call state will be set shortly
thereafter - plus a couple of places where we fail to set the call up, in
which case we're under the call's user_mutex or didn't even manage to fully
allocate it.
That said, I probably should check the call state first. I might also want to
ignore any signal if the call did manage to get connected, lest I leave it
dangling - a problem might come if userspace issues a single sendmsg() to set
up the call and supply data to be transmitted. I need to have a ponder on
that one.
David
Powered by blists - more mailing lists