crypto: algif - suppress sending source address information in recvmsg
PATCH 1/1 crypto: algif - suppress sending source address information in recvmsg
The current code does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local sockaddr_storage variable to userland -- 128 bytes of kernel stack memory. Fix that.
--- crypto/algif_hash.c | 2 ++ crypto/algif_skcipher.c | 1 + 2 files changed, 3 insertions(+)
crypto/algif_hash.c +2 -0
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,else if (len < ds) msg->msg_flags |=MSG_TRUNC ; + msg->msg_namelen =0 ; +lock_sock (sk);if (ctx->more) { ctx->more =0 ;
crypto/algif_skcipher.c +1 -0
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,long copied =0 ;lock_sock (sk); + msg->msg_namelen =0 ;for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen >0 ; iovlen--, iov++) {unsigned long seglen = iov->iov_len;
Signature · 1 line
1.7.10.4
Herbert Xu
maintainerQuoted 5 lines · Mathias Krause
The current code does not set the
msg_namelenmember to 0 and therefore makesnet/socket.cleak the localsockaddr_storagevariable to userland -- 128 bytes of kernel stack memory. Fix that.Signed-off-by Mathias Krause <[email protected]>
Patch applied. Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 8 lines · Herbert Xu
Quoted 5 lines · Mathias Krause
The current code does not set the
msg_namelenmember to 0 and therefore makesnet/socket.cleak the localsockaddr_storagevariable to userland -- 128 bytes of kernel stack memory. Fix that.Signed-off-by Mathias Krause <[email protected]>Patch applied. Thanks!
Thanks, but that patch shouldn't have been applied to cryptodev but crypto instead, and probably queued up for stable as well. I missed the 'Cc: stable # v2.6.38'. My bad.
Mathias
Herbert Xu
maintainerQuoted 6 lines · Mathias Krause
Quoted 5 lines · Herbert Xu
Quoted 4 lines · Mathias Krause
The current code does not set the
msg_namelenmember to 0 and therefore makesnet/socket.cleak the localsockaddr_storagevariable to userland -- 128 bytes of kernel stack memory. Fix that.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Mathias Krause <[email protected]>Patch applied. Thanks!
Thanks, but that patch shouldn't have been applied to cryptodev but crypto instead, and probably queued up for stable as well. I missed the 'Cc: stable # v2.6.38'. My bad.
OK, I'll move it across and add the stable Cc.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 9 lines · Herbert Xu
Quoted 8 lines · Mathias Krause
Quoted 7 lines · Herbert Xu
Quoted 5 lines · Mathias Krause
The current code does not set the
msg_namelenmember to 0 and therefore makesnet/socket.cleak the localsockaddr_storagevariable to userland -- 128 bytes of kernel stack memory. Fix that.Signed-off-by Mathias Krause <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Patch applied. Thanks!
Thanks, but that patch shouldn't have been applied to cryptodev but crypto instead, and probably queued up for stable as well. I missed the 'Cc: stable # v2.6.38'. My bad.
OK, I'll move it across and add the stable Cc.
Any specific reason you're not pushing it to Linus for inclusion in v3.9?
Mathias