lkml.org 
[lkml]   [2021]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [syzbot] INFO: trying to register non-static key in hci_uart_tty_receive (3)
Date
On Saturday, October 23, 2021 1:54:24 AM CEST syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 519d81956ee2 Linux 5.15-rc6
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=16787178b00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=1f7f46d98a0da80e
> dashboard link: https://syzkaller.appspot.com/bug?
extid=f2725165900304ec97b6
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils
for Debian) 2.35.2
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> IMPORTANT: if you fix the issue, please add the following tag to the
commit:
> Reported-by: syzbot+f2725165900304ec97b6@syzkaller.appspotmail.com
>
> INFO: trying to register non-static key.
> The code is fine but needs lockdep annotation, or maybe
> you didn't initialize this object before use?
> turning off the locking correctness validator.

Let's try the solution attached.

Fabio

#syz test
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git masterdiff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 5ed2cfa7da1d..18b039c2f3cf 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -499,11 +499,11 @@ static int hci_uart_tty_open(struct tty_struct *tty)
hu->alignment = 1;
hu->padding = 0;

+ percpu_init_rwsem(&hu->proto_lock);
+
INIT_WORK(&hu->init_ready, hci_uart_init_work);
INIT_WORK(&hu->write_work, hci_uart_write_work);

- percpu_init_rwsem(&hu->proto_lock);
-
/* Flush any pending characters in the driver */
tty_driver_flush_buffer(tty);
\
 
 \ /
  Last update: 2021-10-23 15:47    [W:0.045 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site