Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E932B3FADF1; Mon, 17 Aug 2026 15:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786979199; cv=none; b=D/m8ca1IB8Kb8sxgGc/7cyKayP+mdidJD6GkR3K+T6v9nDQf64xT9q2+KWcSY7VIskX6zbuZBQUuII9JevBhVNq1LLT3TmXvtDvzwyNIl5RKEwd1OiTS9Eap76HPSYqE66h2V1QYgp1073Ue7KvB2/xL2gb4r5ZEzVztOlSGcXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786979199; c=relaxed/simple; bh=0tJhsNT9KcWkKSzSMYH/IhOcQZ72kvN27DW2zHSlPt8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iS/0qHKvLuBMuFbmxrRfxQBe+aicz8zfwqzntgf2YtyXbJH8RP1ea3QrEvpXlpAMvnhsWIG+FIYPHz0YDvalrC4V8VawkjZmbk3pm4B4ZAyqe78tEYsrItQ+wVlxt/y2qGt07RT+wrmyPhaSN7v4enNK0vq9WDfVPdstQrJAG+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qY8pcFyT; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qY8pcFyT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C0BA1F00A3A; Mon, 17 Aug 2026 15:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786979197; bh=57H/nXBofPeoaj7UqV51B6qNwRSz5osmqPZohjTCL1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qY8pcFyTUlAgfxNOu4O9+l1FrZGOosoKwzUzftV5KSgFb5bag5KPjwE2wDaEA4XLd 4zaEUxvaW561WNo6HomMc+p8wDuaxINm4Hg0Rdr6EIjSYXLmLUgLknm4U44pUgi8cv qI6tNCBHqQW1Tfm0SPNmRBs2xFACtIRtO33ICcxo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, AutonomousCodeSecurity@microsoft.com, "Xiang Mei (Microsoft)" , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 141/609] nexthop: initialize extack in nh_res_bucket_migrate() Date: Mon, 17 Aug 2026 15:27:17 +0200 Message-ID: <20260817132548.715869829@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132543.039278408@linuxfoundation.org> References: <20260817132543.039278408@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xiang Mei (Microsoft) [ Upstream commit 6347c5314cee49f364aaf2e40ff15415a57a116e ] nh_res_bucket_migrate() passes an uninitialized netlink_ext_ack to call_nexthop_res_bucket_notifiers(). When nh_notifier_res_bucket_info_init() fails (e.g. the kzalloc returns -ENOMEM), the error is propagated back before any notifier sets extack._msg, and the error path formats the stale pointer with pr_err_ratelimited("%s\n", extack._msg). With CONFIG_INIT_STACK_NONE this dereferences uninitialized stack memory: Oops: general protection fault, probably for non-canonical address ... KASAN: maybe wild-memory-access in range [...] RIP: 0010:string (lib/vsprintf.c:730) vsnprintf (lib/vsprintf.c:2945) _printk (kernel/printk/printk.c:2504) nh_res_bucket_migrate (net/ipv4/nexthop.c:1816) nh_res_table_upkeep (net/ipv4/nexthop.c:1866) rtm_new_nexthop (net/ipv4/nexthop.c:3323) rtnetlink_rcv_msg (net/core/rtnetlink.c:7076) netlink_sendmsg (net/netlink/af_netlink.c:1900) Kernel panic - not syncing: Fatal exception Zero-initialize extack so _msg is NULL on error paths that never set it. Fixes: 7c37c7e00411 ("nexthop: Implement notifiers for resilient nexthop groups") Reported-by: AutonomousCodeSecurity@microsoft.com Signed-off-by: Xiang Mei (Microsoft) Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20260713221551.3344650-1-xmei5@asu.edu Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/nexthop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 49871e5f46802d..13a798f9dc9cb4 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -1504,8 +1504,8 @@ static bool nh_res_bucket_migrate(struct nh_res_table *res_table, bool notify_nl, bool force) { struct nh_res_bucket *bucket = &res_table->nh_buckets[bucket_index]; + struct netlink_ext_ack extack = {}; struct nh_grp_entry *new_nhge; - struct netlink_ext_ack extack; int err; new_nhge = list_first_entry_or_null(&res_table->uw_nh_entries, -- 2.53.0