bisecting fixing commit since 31acccdc877486a649a86d37725a15175fcd5ed6 building syzkaller on 4a7fa9b416fd0a961793328a785666d6d2c5976d testing commit 31acccdc877486a649a86d37725a15175fcd5ed6 with gcc (GCC) 8.1.0 kernel signature: 725632d7071542a505b7af9f1f314a608d2fbb115015ff8b92b7b62f6d46a31b all runs: crashed: INFO: task hung in do_read_cache_page testing current HEAD 675cc038067f0e530471c56a7442935f84669d95 testing commit 675cc038067f0e530471c56a7442935f84669d95 with gcc (GCC) 8.1.0 kernel signature: 0c635a8cb08a1e952d6999bdd549eb64727947f4bd56e1e580cb285bb6213619 all runs: OK # git bisect start 675cc038067f0e530471c56a7442935f84669d95 31acccdc877486a649a86d37725a15175fcd5ed6 Bisecting: 399 revisions left to test after this (roughly 9 steps) [f601479cdbe57f294a8894f35518113cda94cef9] clk: renesas: r9a06g032: Drop __packed for portability testing commit f601479cdbe57f294a8894f35518113cda94cef9 with gcc (GCC) 8.1.0 kernel signature: 5f1d561acdd13eae09ca4ddb1e73db70e73c552a11e69fe17eed08be11685b18 all runs: crashed: INFO: task hung in do_read_cache_page # git bisect good f601479cdbe57f294a8894f35518113cda94cef9 Bisecting: 199 revisions left to test after this (roughly 8 steps) [5e1f3bce394270345d4d966c02367bcca85d060e] media: ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE testing commit 5e1f3bce394270345d4d966c02367bcca85d060e with gcc (GCC) 8.1.0 kernel signature: a06442bfdde1f7733adcdf78560f015dcac50c7d92054de399ab79538b31a956 run #0: crashed: INFO: task hung in do_read_cache_page run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK reproducer seems to be flaky # git bisect good 5e1f3bce394270345d4d966c02367bcca85d060e Bisecting: 99 revisions left to test after this (roughly 7 steps) [074b61ff2127ed1e408f39783b32d1936d6aa3ac] misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doorbells() testing commit 074b61ff2127ed1e408f39783b32d1936d6aa3ac with gcc (GCC) 8.1.0 kernel signature: aedacf76d8a3a64934b6df3b642e663c89ce6fc61f847a41756d3309f33f516e run #0: OK run #1: OK run #2: OK run #3: OK run #4: OK run #5: crashed: INFO: task hung in do_read_cache_page run #6: OK run #7: OK run #8: OK run #9: OK # git bisect good 074b61ff2127ed1e408f39783b32d1936d6aa3ac Bisecting: 49 revisions left to test after this (roughly 6 steps) [5a4fbd8b8a9d65207ac47079f0c5574673bb8773] erspan: fix version 1 check in gre_parse_header() testing commit 5a4fbd8b8a9d65207ac47079f0c5574673bb8773 with gcc (GCC) 8.1.0 kernel signature: f82f9573a45a6565dcc6bf65c29fae8ab1714e7c7ff4cd74656f13b5e4d66e2b all runs: OK # git bisect bad 5a4fbd8b8a9d65207ac47079f0c5574673bb8773 Bisecting: 24 revisions left to test after this (roughly 5 steps) [f7889f64b82568ee59af5df79af2a010851b65d3] scsi: ufs: Fix wrong print message in dev_err() testing commit f7889f64b82568ee59af5df79af2a010851b65d3 with gcc (GCC) 8.1.0 kernel signature: 9e2f2b84a2c73f5e59e4f19d763079653b05da4e3141b34b00fabeead6b610a8 all runs: OK # git bisect bad f7889f64b82568ee59af5df79af2a010851b65d3 Bisecting: 12 revisions left to test after this (roughly 4 steps) [63d881957e59dde38f38100631ae138d5c0cee88] dm verity: skip verity work if I/O error when system is shutting down testing commit 63d881957e59dde38f38100631ae138d5c0cee88 with gcc (GCC) 8.1.0 kernel signature: f95d8cc8a8fe18df813f5e32b6db0dbed28c887829a6e1fa0127812b757703cc all runs: OK # git bisect bad 63d881957e59dde38f38100631ae138d5c0cee88 Bisecting: 5 revisions left to test after this (roughly 3 steps) [bea7f4d1ffa33ced2801947eb70e400387b07575] module: set MODULE_STATE_GOING state when a module fails to load testing commit bea7f4d1ffa33ced2801947eb70e400387b07575 with gcc (GCC) 8.1.0 kernel signature: faf478e43f98a6dacb272387086f735bb5ca149c13d8d1fc89cbb6eed4adbc3c all runs: OK # git bisect bad bea7f4d1ffa33ced2801947eb70e400387b07575 Bisecting: 2 revisions left to test after this (roughly 2 steps) [64b2a977e116835dbe184a2f44d90b61c84fb5e8] ALSA: rawmidi: Access runtime->avail always in spinlock testing commit 64b2a977e116835dbe184a2f44d90b61c84fb5e8 with gcc (GCC) 8.1.0 kernel signature: 0111eccd87beb96dad007eb31751736ddb6b7385838aeb601e16ad88fc8cce86 run #0: crashed: INFO: task hung in blkdev_put run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: crashed: INFO: task hung in blkdev_put run #8: OK run #9: OK # git bisect good 64b2a977e116835dbe184a2f44d90b61c84fb5e8 Bisecting: 0 revisions left to test after this (roughly 1 step) [4cb33d97b067682e4e3c398a57426e4c7e493a3d] rtc: sun6i: Fix memleak in sun6i_rtc_clk_init testing commit 4cb33d97b067682e4e3c398a57426e4c7e493a3d with gcc (GCC) 8.1.0 kernel signature: 37c6ed3256bf59eb3d17c904cb73f293361a92e0bdf05d475a6628d5bd81326e run #0: basic kernel testing failed: BUG: program execution failed: executor 0: failed to write control pipe: write |1: broken pipe run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK # git bisect bad 4cb33d97b067682e4e3c398a57426e4c7e493a3d Bisecting: 0 revisions left to test after this (roughly 0 steps) [8e63266b0d42a2dc233cfc468636889b5b3ba1cf] fcntl: Fix potential deadlock in send_sig{io, urg}() testing commit 8e63266b0d42a2dc233cfc468636889b5b3ba1cf with gcc (GCC) 8.1.0 kernel signature: 37c6ed3256bf59eb3d17c904cb73f293361a92e0bdf05d475a6628d5bd81326e all runs: OK # git bisect bad 8e63266b0d42a2dc233cfc468636889b5b3ba1cf 8e63266b0d42a2dc233cfc468636889b5b3ba1cf is the first bad commit commit 8e63266b0d42a2dc233cfc468636889b5b3ba1cf Author: Boqun Feng Date: Thu Nov 5 14:23:51 2020 +0800 fcntl: Fix potential deadlock in send_sig{io, urg}() commit 8d1ddb5e79374fb277985a6b3faa2ed8631c5b4c upstream. Syzbot reports a potential deadlock found by the newly added recursive read deadlock detection in lockdep: [...] ======================================================== [...] WARNING: possible irq lock inversion dependency detected [...] 5.9.0-rc2-syzkaller #0 Not tainted [...] -------------------------------------------------------- [...] syz-executor.1/10214 just changed the state of lock: [...] ffff88811f506338 (&f->f_owner.lock){.+..}-{2:2}, at: send_sigurg+0x1d/0x200 [...] but this lock was taken by another, HARDIRQ-safe lock in the past: [...] (&dev->event_lock){-...}-{2:2} [...] [...] [...] and interrupts could create inverse lock ordering between them. [...] [...] [...] other info that might help us debug this: [...] Chain exists of: [...] &dev->event_lock --> &new->fa_lock --> &f->f_owner.lock [...] [...] Possible interrupt unsafe locking scenario: [...] [...] CPU0 CPU1 [...] ---- ---- [...] lock(&f->f_owner.lock); [...] local_irq_disable(); [...] lock(&dev->event_lock); [...] lock(&new->fa_lock); [...] [...] lock(&dev->event_lock); [...] [...] *** DEADLOCK *** The corresponding deadlock case is as followed: CPU 0 CPU 1 CPU 2 read_lock(&fown->lock); spin_lock_irqsave(&dev->event_lock, ...) write_lock_irq(&filp->f_owner.lock); // wait for the lock read_lock(&fown-lock); // have to wait until the writer release // due to the fairness spin_lock_irqsave(&dev->event_lock); // wait for the lock The lock dependency on CPU 1 happens if there exists a call sequence: input_inject_event(): spin_lock_irqsave(&dev->event_lock,...); input_handle_event(): input_pass_values(): input_to_handler(): handler->event(): // evdev_event() evdev_pass_values(): spin_lock(&client->buffer_lock); __pass_event(): kill_fasync(): kill_fasync_rcu(): read_lock(&fa->fa_lock); send_sigio(): read_lock(&fown->lock); To fix this, make the reader in send_sigurg() and send_sigio() use read_lock_irqsave() and read_lock_irqrestore(). Reported-by: syzbot+22e87cdf94021b984aa6@syzkaller.appspotmail.com Reported-by: syzbot+c5e32344981ad9f33750@syzkaller.appspotmail.com Signed-off-by: Boqun Feng Signed-off-by: Jeff Layton Signed-off-by: Greg Kroah-Hartman fs/fcntl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) culprit signature: 37c6ed3256bf59eb3d17c904cb73f293361a92e0bdf05d475a6628d5bd81326e parent signature: 0111eccd87beb96dad007eb31751736ddb6b7385838aeb601e16ad88fc8cce86 Reproducer flagged being flaky revisions tested: 12, total time: 3h49m35.376806701s (build: 1h42m15.74691766s, test: 2h6m7.40988473s) first good commit: 8e63266b0d42a2dc233cfc468636889b5b3ba1cf fcntl: Fix potential deadlock in send_sig{io, urg}() recipients (to): ["boqun.feng@gmail.com" "gregkh@linuxfoundation.org" "jlayton@kernel.org"] recipients (cc): []