From: Li RongQing <redacted>
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 <redacted>
---
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