From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+f3f3eef1d2100200e593@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
Date: Fri, 19 Apr 2024 19:54:10 +0800 [thread overview]
Message-ID: <20240419115410.2816-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000c1fa0506166fdcfe@google.com>
On Fri, 19 Apr 2024 02:39:21 -0700
> syzbot found the following issue on:
>
> HEAD commit: 7b4f2bc91c15 Add linux-next specific files for 20240418
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=128b1d53180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 7b4f2bc91c15
--- x/net/unix/garbage.c
+++ y/net/unix/garbage.c
@@ -205,6 +205,7 @@ void unix_add_edges(struct scm_fp_list *
edge = fpl->edges + i++;
edge->predecessor = inflight;
edge->successor = receiver;
+ sock_hold((struct sock *)receiver);
unix_add_edge(fpl, edge);
} while (i < fpl->count_unix);
@@ -225,6 +226,7 @@ void unix_del_edges(struct scm_fp_list *
{
struct unix_sock *receiver;
int i = 0;
+ int j;
spin_lock(&unix_gc_lock);
@@ -246,6 +248,12 @@ out:
spin_unlock(&unix_gc_lock);
fpl->inflight = false;
+
+ for (j = 0; j < i; j++) {
+ struct unix_edge *edge = fpl->edges + j;
+
+ sock_put((struct sock *)(edge->successor));
+ }
}
void unix_update_edges(struct unix_sock *receiver)
--
next prev parent reply other threads:[~2024-04-19 11:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 9:39 syzbot
2024-04-19 11:54 ` Hillf Danton [this message]
2024-04-19 14:36 ` syzbot
2024-04-19 19:17 ` Kuniyuki Iwashima
2024-04-19 20:39 ` Kuniyuki Iwashima
2024-04-19 21:13 ` syzbot
2024-04-21 4: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=20240419115410.2816-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+f3f3eef1d2100200e593@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®