From: Greg Kroah-Hartman Date: Mon, 6 Apr 2026 15:34:22 +0000 (+0200) Subject: xfrm_user: fix info leak in build_report() X-Git-Tag: v6.1.169~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0616314b3b34f24cbb91da8c6bd8bcdc4c8592f9;p=thirdparty%2Fkernel%2Fstable.git xfrm_user: fix info leak in build_report() commit d10119968d0e1f2b669604baf2a8b5fdb72fa6b4 upstream. struct xfrm_user_report is a __u8 proto field followed by a struct xfrm_selector which means there is three "empty" bytes of padding, but the padding is never zeroed before copying to userspace. Fix that up by zeroing the structure before setting individual member variables. Cc: stable Cc: Steffen Klassert Cc: Herbert Xu Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Assisted-by: gregkh_clanker_t1000 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e4f9b98a46d9c..d70640a0f27ff 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3679,6 +3679,7 @@ static int build_report(struct sk_buff *skb, u8 proto, return -EMSGSIZE; ur = nlmsg_data(nlh); + memset(ur, 0, sizeof(*ur)); ur->proto = proto; memcpy(&ur->sel, sel, sizeof(ur->sel));