From: Pavel Skripkin <paskripkin@gmail.com>
To: syzbot <syzbot+7d41312fe3f123a6f605@syzkaller.appspotmail.com>,
gregkh@linuxfoundation.org, len.brown@intel.com,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
pavel@ucw.cz, rjw@rjwysocki.net, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] KASAN: null-ptr-deref Write in __pm_runtime_resume
Date: Thu, 2 Sep 2021 22:19:08 +0300 [thread overview]
Message-ID: <fd90b222-4394-946a-24f8-fe3943e840ab@gmail.com> (raw)
In-Reply-To: <00000000000002044305caf6fd02@google.com>
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]
On 9/2/21 01:57, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 835d31d319d9 Merge tag 'media/v5.15-1' of git://git.kernel..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1374b85d300000
> kernel config: https://syzkaller.appspot.com/x/.config?x=9c32e23fada3a0e4
> dashboard link: https://syzkaller.appspot.com/bug?extid=7d41312fe3f123a6f605
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.1
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16fde215300000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11aa9149300000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+7d41312fe3f123a6f605@syzkaller.appspotmail.com
>
> Bluetooth: : Invalid header checksum
> Bluetooth: : Invalid header checksum
> ==================================================================
> BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
> BUG: KASAN: null-ptr-deref in atomic_inc include/linux/atomic/atomic-instrumented.h:181 [inline]
> BUG: KASAN: null-ptr-deref in __pm_runtime_resume+0x154/0x180 drivers/base/power/runtime.c:1105
> Write of size 4 at addr 0000000000000388 by task kworker/u4:4/244
>
Looks like missing if (hu->serdev)
#syz test
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
With regards,
Pavel Skripkin
[-- Attachment #2: 0001-Bluetooth-hci-fix-GPF-in-h5_recv.patch --]
[-- Type: text/x-patch, Size: 976 bytes --]
From a30dfa93fc6f7e2ecc7759ac75c742e512b527f0 Mon Sep 17 00:00:00 2001
From: Pavel Skripkin <paskripkin@gmail.com>
Date: Thu, 2 Sep 2021 22:17:05 +0300
Subject: [PATCH] Bluetooth: hci: fix GPF in h5_recv
/* ... */
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
drivers/bluetooth/hci_h5.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 0c0dedece59c..eb0099a21288 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -587,9 +587,11 @@ static int h5_recv(struct hci_uart *hu, const void *data, int count)
count -= processed;
}
- pm_runtime_get(&hu->serdev->dev);
- pm_runtime_mark_last_busy(&hu->serdev->dev);
- pm_runtime_put_autosuspend(&hu->serdev->dev);
+ if (hu->serdev) {
+ pm_runtime_get(&hu->serdev->dev);
+ pm_runtime_mark_last_busy(&hu->serdev->dev);
+ pm_runtime_put_autosuspend(&hu->serdev->dev);
+ }
return 0;
}
--
2.33.0
next prev parent reply other threads:[~2021-09-02 19:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-28 4:44 syzbot
2021-09-01 22:57 ` syzbot
2021-09-02 19:19 ` Pavel Skripkin [this message]
2021-09-02 19:55 ` syzbot
2021-09-02 18:13 ` 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=fd90b222-4394-946a-24f8-fe3943e840ab@gmail.com \
--to=paskripkin@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=syzbot+7d41312fe3f123a6f605@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®