From: David Howells <dhowells@redhat.com>
To: Hillf Danton <hdanton@sina.com>
Cc: dhowells@redhat.com,
syzbot <syzbot+174de899852504e4a74a@syzkaller.appspotmail.com>,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com,
syzbot+3d1c772efafd3c38d007@syzkaller.appspotmail.com
Subject: Re: KASAN: use-after-free Read in rxrpc_send_data_packet
Date: Mon, 01 Feb 2021 10:12:36 +0000 [thread overview]
Message-ID: <4107618.1612174356@warthog.procyon.org.uk> (raw)
In-Reply-To: <20210201094403.1979-1-hdanton@sina.com>
Hillf Danton <hdanton@sina.com> wrote:
> --- a/net/rxrpc/call_object.c
> +++ b/net/rxrpc/call_object.c
> @@ -549,6 +549,7 @@ void rxrpc_release_call(struct rxrpc_soc
> if (call->security)
> call->security->free_call_crypto(call);
>
> + cancel_work_sync(&call->processor);
> rxrpc_cleanup_ring(call);
> _leave("");
> }
It's probably better to do the cancellation before we call
->free_call_crypto().
Two other alternatives would be to lock in rxrpc_cleanup_ring() or just remove
that call of rxrpc_cleanup_ring() and leave it to rxrpc_cleanup_call() (which
calls it anyway). The latter might be the best option as the work function
holds a ref on the call.
Clearing the ring in rxrpc_release_call() is more of an optimisation, meant to
recycle skbuffs sooner, but I would hope that the call would be destroyed
quickly after this point anyway.
David
next prev parent reply other threads:[~2021-02-01 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210201094403.1979-1-hdanton@sina.com>
2021-02-01 8:03 ` syzbot
2021-02-01 10:12 ` David Howells [this message]
2021-02-01 11:05 ` David Howells
2021-02-01 11:05 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4107618.1612174356@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=hdanton@sina.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+174de899852504e4a74a@syzkaller.appspotmail.com \
--cc=syzbot+3d1c772efafd3c38d007@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®