mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] rxrpc: rxgk: Fix uninitialised stack byte leaked via RXRPC_CHALLENGED
@ 2026-11-12 11:43 lirongqing
  2026-11-18 20:30 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: lirongqing @ 2026-11-12 11:43 UTC (permalink / raw)
  To: David Howells, Marc Dionne, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, linux-afs, netdev,
	linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

rxgk_challenge_to_recvmsg() builds struct rxgk_challenge on the stack
and passes all 8 bytes to put_cmsg() via RXRPC_CHALLENGED, but never
initialises base.pad at offset 3. The struct has no implicit padding,
so this byte contain leftover kernel stack data and be exposed to
userspace. This issue was identified by code inspection.

Zero-initialise the structure to prevent the potential information leak.

Fixes: 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/rxrpc/rxgk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rxrpc/rxgk.c b/net/rxrpc/rxgk.c
index 77a67ac..15533f4 100644
--- a/net/rxrpc/rxgk.c
+++ b/net/rxrpc/rxgk.c
@@ -756,7 +756,7 @@ static int rxgk_challenge_to_recvmsg(struct rxrpc_connection *conn,
 				     struct sk_buff *challenge,
 				     struct msghdr *msg)
 {
-	struct rxgk_challenge chall;
+	struct rxgk_challenge chall = { };
 
 	chall.base.service_id		= conn->service_id;
 	chall.base.security_index	= conn->security_ix;
-- 
2.9.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-18 20:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 11:43 [PATCH net] rxrpc: rxgk: Fix uninitialised stack byte leaked via RXRPC_CHALLENGED lirongqing
2026-11-18 20:30 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®