public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+5a630f8ca0120ab43f55@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [kernel?] KASAN: slab-use-after-free Read in __unix_gc
Date: Sat, 10 Feb 2024 14:35:25 +0800	[thread overview]
Message-ID: <20240210063527.792-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000ee09930610f42470@google.com>

On Fri, 09 Feb 2024 06:57:17 -0800
> HEAD commit:    e7689879d14e ethtool: do not use rtnl in ethnl_default_dum..
> git tree:       net-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=165f9cec180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git  main

--- x/net/unix/garbage.c
+++ y/net/unix/garbage.c
@@ -119,6 +119,7 @@ void unix_inflight(struct user_struct *u
 		if (!u->inflight) {
 			WARN_ON_ONCE(!list_empty(&u->link));
 			list_add_tail(&u->link, &gc_inflight_list);
+			sock_hold(&u->sk);
 		} else {
 			WARN_ON_ONCE(list_empty(&u->link));
 		}
@@ -350,6 +351,11 @@ static void __unix_gc(struct work_struct
 	}
 #endif
 
+	list_for_each_entry_safe(u, next, &gc_candidates, link) {
+		list_del(&u->link);
+		sock_put(&u->sk);
+	}
+
 	spin_lock(&unix_gc_lock);
 
 	/* All candidates should have been detached by now. */
--

  parent reply	other threads:[~2024-02-10  6:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 14:57 [syzbot] [kernel?] KASAN: slab-use-after-free Read in __unix_gc syzbot
2024-02-10  2:24 ` Hillf Danton
2024-02-10  4:08   ` syzbot
2024-02-10  6:35 ` Hillf Danton [this message]
2024-02-10  7:03   ` syzbot
2024-02-10  8:10 ` Kuniyuki Iwashima
2024-02-10 10:07 ` Hillf Danton
2024-02-10 11:39   ` 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=20240210063527.792-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+5a630f8ca0120ab43f55@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