From: Paolo Abeni <pabeni@redhat.com>
To: eadavis@sina.com, syzbot+666c97e4686410e79649@syzkaller.appspotmail.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
linux-hams@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, ralf@linux-mips.org,
syzkaller-bugs@googlegroups.com, hdanton@sina.com
Subject: Re: [PATCH] sock: Fix sk_sleep return invalid pointer
Date: Tue, 22 Aug 2023 17:31:00 +0200 [thread overview]
Message-ID: <f80fcd476a230c354bf9758762250c43a1f3d5cc.camel@redhat.com> (raw)
In-Reply-To: <20230822124419.1838055-1-eadavis@sina.com>
On Tue, 2023-08-22 at 20:44 +0800, eadavis@sina.com wrote:
> From: Edward AD <eadavis@sina.com>
>
> The parameter sk_sleep(sk) passed in when calling prepare_to_wait may
> return an invalid pointer due to nr-release reclaiming the sock.
> Here, schedule_timeout_interruptible is used to replace the combination
> of 'prepare_to_wait, schedule, finish_wait' to solve the problem.
>
> Reported-and-tested-by: syzbot+666c97e4686410e79649@syzkaller.appspotmail.com
> Signed-off-by: Edward AD <eadavis@sina.com>
This looks wrong. No syscall should race with sock_release(). It looks
like you are papering over the real issue.
As the reproducer shows a disconnect on an connected socket, I'm wild
guessing something alike 4faeee0cf8a5d88d63cdbc3bab124fb0e6aed08c
should be more appropriate.
Cheers,
Paolo
prev parent reply other threads:[~2023-08-22 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 16:36 [syzbot] [hams?] general protection fault in prepare_to_wait (2) syzbot
[not found] ` <20230822124419.1838055-1-eadavis@sina.com>
2023-08-22 15:31 ` Paolo Abeni [this message]
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=f80fcd476a230c354bf9758762250c43a1f3d5cc.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=eadavis@sina.com \
--cc=edumazet@google.com \
--cc=hdanton@sina.com \
--cc=kuba@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=syzbot+666c97e4686410e79649@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
Powered by JetHome