[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240419115410.2816-1-hdanton@sina.com>
Date: Fri, 19 Apr 2024 19:54:10 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+f3f3eef1d2100200e593@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [net?] KASAN: slab-use-after-free Read in unix_del_edges
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)
--
Powered by blists - more mailing lists