From nobody Mon Apr 6 18:22:34 2026 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45CB23D5239 for ; Wed, 18 Mar 2026 12:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773835500; cv=none; b=tGhcOB6zTxls5pWa7SBkizB6jnrawNmOEbXLwjDRiKGZXGLwsC37UsxE8TyX4kenucYVZa7D+QG0PmjesGue3Mp92FJapIvjqUNWPKmD/UnLGv7GGlu+pMYjWF9DCfWNtR3Wl9YnHnLjDTjpZkTBIXboCGCIGx2eHD6l2sUTnwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773835500; c=relaxed/simple; bh=Z0Z2BlVRzLfHukbKqKE6vFdrozWCUJYnzLFx2imMFg0=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Eih/uslrAUzW0yBcEHNj1VpzMI81LkzZ5G4SllVGVCHGiKONV3LO5n7263rdXgkzrRWoBYtleFwjbkknk2DYcOnV/1HBNzwz/FlKkm6mQjdk1o5Ez/897MzCFaFWGzY+toRXiAP1DZMrhodDj7O2MtJuWkie88xNYvY9fylUSB0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-67bf2b72878so37282094eaf.2 for ; Wed, 18 Mar 2026 05:04:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773835498; x=1774440298; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fZETDVuSbm0AAR59+5IbB3LZbP1f2t++yJ+OFNM1o78=; b=qpnjKDJQRib0V96ovgXBQmFpEErtPKxhiJACjvvKxat5p6t922YtPo7UOSV8BJ4hOF siU/gwz+4LT93slKVxghHSAAiF+7mHusAH+3odJzpY566a+sGZTvO3PJ58FeLkuHy/kc Bhc6kM/1c24qy57T9xZKHjyJ9sLSHTt1YZx7bMrZm+PdRMmReqhmNxedigs5yKzVwddJ Y/iMyddi/+CX5bJWuYINzkPAB3feRZzGnbIP06MX/HCCD2ACU1PJyC107yoWwiYhGbVz Yn4302GMehUQGMeKlcuuDNJ3MubE1fvFTTHDwycQLhxKcCvFDa8z39d5oN4YYXAmE5SU gY8Q== X-Gm-Message-State: AOJu0YyWxchhSRq1MnAOF5T398dAX04kQBhZBu//+ba6Fgxoo07gsMab NnHsB/vUy20h7KYBVElIlbfq1stHrM7SF4HH4BQCcQCzSFfjOofpvS06DEbtcRDAlHdqN2SKD5D Xi7vhxT7ec/rAoMz77SKlzfSMJXYgs0nPPReTPdJMBujwu9Yg1O9gK2CWUEw= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:8107:b0:67b:e4a1:9e55 with SMTP id 006d021491bc7-67c0db0d2e6mr1700340eaf.42.1773835497997; Wed, 18 Mar 2026 05:04:57 -0700 (PDT) Date: Wed, 18 Mar 2026 05:04:57 -0700 In-Reply-To: <69a486ee.050a0220.3a55be.0067.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69ba94e9.050a0220.3a088d.0001.GAE@google.com> Subject: Forwarded: [PATCH] netdevsim: fib: replace flush_work() with cancel_work_sync() for fib_event_work From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] netdevsim: fib: replace flush_work() with cancel_work_sync= () for fib_event_work Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master flush_work() waits for fib_event_work to finish executing. However, fib_event_work holds fib_lock while running, and nsim_fib_flush_work() also tries to acquire fib_lock after flush_work() returns. If fib_event_work takes a long time or is blocked, flush_work() can wait indefinitely, causing a hung task. Replace all occurrences of flush_work(&data->fib_event_work) with cancel_work_sync(&data->fib_event_work) to safely cancel any pending work without waiting indefinitely. This fixes a hung task reported by syzkaller: INFO: task kworker/1:8 blocked for more than 159 seconds The following call chain triggers the hang: nsim_fib_flush_work() flush_work(&data->fib_event_work) <- waits forever nsim_fib_event_work() mutex_lock(&data->fib_lock) <- held here Reported-by: syzbot+7c11975a7e4a2735d529@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3D7c11975a7e4a2735d529 Signed-off-by: Deepanshu Kartikey --- drivers/net/netdevsim/fib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c index 1a42bdbfaa41..f08517ee583c 100644 --- a/drivers/net/netdevsim/fib.c +++ b/drivers/net/netdevsim/fib.c @@ -1094,7 +1094,7 @@ static void nsim_fib_dump_inconsistent(struct notifie= r_block *nb) struct nsim_fib_rt *fib_rt, *fib_rt_tmp; =20 /* Flush the work to make sure there is no race with notifications. */ - flush_work(&data->fib_event_work); + cancel_work_sync(&data->fib_event_work); =20 /* The notifier block is still not registered, so we do not need to * take any locks here. @@ -1505,7 +1505,7 @@ static void nsim_fib_flush_work(struct work_struct *w= ork) struct nsim_fib_rt *fib_rt, *fib_rt_tmp; =20 /* Process pending work. */ - flush_work(&data->fib_event_work); + cancel_work_sync(&data->fib_event_work); =20 mutex_lock(&data->fib_lock); list_for_each_entry_safe(fib_rt, fib_rt_tmp, &data->fib_rt_list, list) { @@ -1626,7 +1626,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink = *devlink, unregister_nexthop_notifier(devlink_net(devlink), &data->nexthop_nb); err_rhashtable_fib_destroy: cancel_work_sync(&data->fib_flush_work); - flush_work(&data->fib_event_work); + cancel_work_sync(&data->fib_event_work); rhashtable_free_and_destroy(&data->fib_rt_ht, nsim_fib_rt_free, data); err_rhashtable_nexthop_destroy: @@ -1656,7 +1656,7 @@ void nsim_fib_destroy(struct devlink *devlink, struct= nsim_fib_data *data) unregister_fib_notifier(devlink_net(devlink), &data->fib_nb); unregister_nexthop_notifier(devlink_net(devlink), &data->nexthop_nb); cancel_work_sync(&data->fib_flush_work); - flush_work(&data->fib_event_work); + cancel_work_sync(&data->fib_event_work); rhashtable_free_and_destroy(&data->fib_rt_ht, nsim_fib_rt_free, data); rhashtable_free_and_destroy(&data->nexthop_ht, nsim_nexthop_free, --=20 2.43.0