mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+a68ef3b1f46bc3aced5c@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] INFO: rcu detected stall in syscall_exit_to_user_mode (2)
Date: Fri,  8 Mar 2024 20:09:30 +0800	[thread overview]
Message-ID: <20240308120930.1718-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000081ff305f0b14072@google.com>

On Sun, 25 Dec 2022 17:42:37 -0800
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    72a85e2b0a1e Merge tag 'spi-fix-v6.2-rc1' of git://git.ker..
> git tree:       upstream
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12569d7f880000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master

--- x/drivers/media/rc/imon.c
+++ y/drivers/media/rc/imon.c
@@ -1758,6 +1758,7 @@ static void usb_rx_callback_intf0(struct
 
 	switch (urb->status) {
 	case -ENOENT:		/* usbcore unlink successful! */
+	case -EPROTO:
 		return;
 
 	case -ESHUTDOWN:	/* transport endpoint was shut down */
--- x/net/batman-adv/network-coding.c
+++ y/net/batman-adv/network-coding.c
@@ -397,6 +397,7 @@ static void batadv_nc_purge_orig_hash(st
 	struct hlist_head *head;
 	struct batadv_orig_node *orig_node;
 	u32 i;
+	int loop = 0;
 
 	if (!hash)
 		return;
@@ -406,9 +407,14 @@ static void batadv_nc_purge_orig_hash(st
 		head = &hash->table[i];
 
 		rcu_read_lock();
-		hlist_for_each_entry_rcu(orig_node, head, hash_entry)
+		hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
 			batadv_nc_purge_orig(bat_priv, orig_node,
 					     batadv_nc_to_purge_nc_node);
+			if (++loop > 20) {
+				rcu_read_unlock();
+				return;
+			}
+		}
 		rcu_read_unlock();
 	}
 }
@@ -433,6 +439,7 @@ static void batadv_nc_purge_paths(struct
 	struct batadv_nc_path *nc_path;
 	spinlock_t *lock; /* Protects lists in hash */
 	u32 i;
+	int loop = 0;
 
 	for (i = 0; i < hash->size; i++) {
 		head = &hash->table[i];
@@ -441,6 +448,10 @@ static void batadv_nc_purge_paths(struct
 		/* For each nc_path in this bin */
 		spin_lock_bh(lock);
 		hlist_for_each_entry_safe(nc_path, node_tmp, head, hash_entry) {
+			if (++loop > 20) {
+				spin_unlock_bh(lock);
+				return;
+			}
 			/* if an helper function has been passed as parameter,
 			 * ask it if the entry has to be purged or not
 			 */
@@ -675,6 +686,7 @@ batadv_nc_process_nc_paths(struct batadv
 	struct batadv_nc_path *nc_path;
 	bool ret;
 	int i;
+	int loop = 0;
 
 	if (!hash)
 		return;
@@ -686,6 +698,10 @@ batadv_nc_process_nc_paths(struct batadv
 		/* Loop coding paths */
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(nc_path, head, hash_entry) {
+			if (++loop > 20) {
+				rcu_read_unlock();
+				return;
+			}
 			/* Loop packets */
 			spin_lock_bh(&nc_path->packet_list_lock);
 			list_for_each_entry_safe(nc_packet, nc_packet_tmp,
--

  parent reply	other threads:[~2024-03-08 12:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 19:46 syzbot
2022-12-26  1:42 ` syzbot
2024-03-08 10:33   ` Hillf Danton
2024-03-08 10:55     ` [syzbot] [usb] " syzbot
2024-03-08 12:09   ` Hillf Danton [this message]
2024-03-08 12:40     ` syzbot
     [not found] <20221226033428.2301-1-hdanton@sina.com>
2022-12-26  8:28 ` [syzbot] " syzbot
     [not found] <20221226085641.2445-1-hdanton@sina.com>
2022-12-26  9:06 ` 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=20240308120930.1718-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+a68ef3b1f46bc3aced5c@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®