From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 391F73BBA17 for ; Mon, 13 Apr 2026 12:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776084142; cv=none; b=uq4pc4UEMqrPTpkK/tSM6xBSLdmV5FzSq7Wmtq8QzQPSjHJcCZfTKTfZ6D8pSI9tmE8M4J4s6bsSHlUyipFJedzHGpDNcWTv0A0tNLJIhsWBJrRorGfGCKSI9jybVce4+Y1nzse9nIG19nAca8THTN/OuWLSkTsIQwSkCtSrimM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776084142; c=relaxed/simple; bh=ozlIAE1FTEKvu3WmVQnAo+VZxrVgz6kmxgoYW/nyfNw=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=k1Fljdz1Eucz0g1/oYaYzBhz2UgWZE5ieF9AUKkhTCibQL09uaSC0LB0wt1bG2N+sVaJjhC6b38auhr2uvr3/ozfRJIiVLY+tUFWRnU1bfQ9DG+NZjmGMItqiZdIGcG6AAmeiBfnwcqRkJfA9Oe8F/2KrwEul7etskS0MyU0xGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Pa857xFT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Pa857xFT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69312C2BCAF; Mon, 13 Apr 2026 12:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776084141; bh=ozlIAE1FTEKvu3WmVQnAo+VZxrVgz6kmxgoYW/nyfNw=; h=Subject:To:Cc:From:Date:From; b=Pa857xFThB4a5B/VaUZcfLj+LbaNjWdXsyRNV5pAen16FDjlliat2Xecs+dEQXvGy GYCwVEi0NaUmC9xK52hr/5vcleCA6WN8U5c/nnvpQUxe6dhHV+A6UxDpF6sxG+suDO nNHkvRIrgs1Gd0del+aLha6ou+jgQDrZmnB5oCoY= Subject: FAILED: patch "[PATCH] xfrm: clear trailing padding in build_polexpire()" failed to apply to 5.15-stable tree To: yasuakitorimaru@gmail.com,horms@kernel.org,leitao@debian.org,steffen.klassert@secunet.com Cc: From: Date: Mon, 13 Apr 2026 14:21:32 +0200 Message-ID: <2026041331-wiring-revenge-aec2@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 71a98248c63c535eaa4d4c22f099b68d902006d0 # git commit -s git send-email --to '' --in-reply-to '2026041331-wiring-revenge-aec2@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 71a98248c63c535eaa4d4c22f099b68d902006d0 Mon Sep 17 00:00:00 2001 From: Yasuaki Torimaru Date: Thu, 26 Mar 2026 14:58:00 +0900 Subject: [PATCH] xfrm: clear trailing padding in build_polexpire() build_expire() clears the trailing padding bytes of struct xfrm_user_expire after setting the hard field via memset_after(), but the analogous function build_polexpire() does not do this for struct xfrm_user_polexpire. The padding bytes after the __u8 hard field are left uninitialized from the heap allocation, and are then sent to userspace via netlink multicast to XFRMNLGRP_EXPIRE listeners, leaking kernel heap memory contents. Add the missing memset_after() call, matching build_expire(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Yasuaki Torimaru Reviewed-by: Simon Horman Reviewed-by: Breno Leitao Signed-off-by: Steffen Klassert diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 1656b487f833..5d59c11fc01e 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3960,6 +3960,8 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, return err; } upe->hard = !!hard; + /* clear the padding bytes */ + memset_after(upe, 0, hard); nlmsg_end(skb, nlh); return 0;