rxrpc: rxgk: Initialize challenge control message
Subsystems (4)
PATCH 1/1 rxrpc: rxgk: Initialize challenge control message
rxgk_challenge_to_recvmsg() copies the complete rxgk_challenge structure into an RXRPC_CHALLENGED control message. The pad member of the embedded rxrpc_challenge is not assigned, so the copy can disclose one byte of kernel stack memory to userspace.
Initialize the whole structure before filling its meaningful fields so that the reserved byte is always zero.
--- net/rxrpc/rxgk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/rxrpc/rxgk.c +1 -1
@@ -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;
Signature · 1 line
2.55.0
Quoted 5 lines · Weiming Shi
rxgk_challenge_to_recvmsg()copies the completerxgk_challengestructure into anRXRPC_CHALLENGEDcontrol message. The pad member of the embeddedrxrpc_challengeis not assigned, so the copy can disclose one byte of kernel stack memory to userspace.
Quoted 8 lines
Initialize the whole structure before filling its meaningful fields so that the reserved byte is always zero.
Fixes 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")Reported-by <[email protected]>Assisted-by LLMSigned-off-by Weiming Shi <[email protected]>
...