[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250826073149.5659-1-hdanton@sina.com>
Date: Tue, 26 Aug 2025 15:31:47 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+a25ee9d20d31e483ba7b@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [net?] KASAN: slab-use-after-free Write in __xfrm_state_delete
> Date: Sun, 24 Aug 2025 12:21:23 -0700 [thread overview]
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: b1c92cdf5af3 Merge branch 'net-wangxun-complete-ethtool-co..
> git tree: net-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1411b062580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=67b99ceb67d33475
> dashboard link: https://syzkaller.appspot.com/bug?extid=a25ee9d20d31e483ba7b
> compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14221862580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=159fba34580000
#syz test
--- x/net/xfrm/xfrm_state.c
+++ y/net/xfrm/xfrm_state.c
@@ -618,6 +618,8 @@ static void xfrm_state_gc_destroy(struct
xfrm_state_free(x);
}
+static DEFINE_MUTEX(notify_mutex);
+
static void xfrm_state_gc_task(struct work_struct *work)
{
struct xfrm_state *x;
@@ -630,8 +632,10 @@ static void xfrm_state_gc_task(struct wo
synchronize_rcu();
+ mutex_lock(¬ify_mutex);
hlist_for_each_entry_safe(x, tmp, &gc_list, gclist)
xfrm_state_gc_destroy(x);
+ mutex_unlock(¬ify_mutex);
}
static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me)
@@ -921,6 +925,7 @@ int xfrm_state_flush(struct net *net, u8
{
int i, err = 0, cnt = 0;
+ mutex_lock(¬ify_mutex);
spin_lock_bh(&net->xfrm.xfrm_state_lock);
err = xfrm_state_flush_secctx_check(net, proto, task_valid);
if (err)
@@ -950,6 +955,7 @@ restart:
}
out:
spin_unlock_bh(&net->xfrm.xfrm_state_lock);
+ mutex_unlock(¬ify_mutex);
if (cnt)
err = 0;
--
Powered by blists - more mailing lists