inet: fix addr_len/msg->msg_namelen assignment in recv_error and rxpmtu functions
Commitbceaa90240
("inet: prevent leakage of uninitialized memory to user in recv syscalls") conditionally updated addr_len if the msg_name is written to. The recv_error and rxpmtu functions relied on the recvmsg functions to set up addr_len before. As this does not happen any more we have to pass addr_len to those functions as well and set it to the size of the corresponding sockaddr length. This broke traceroute and such. Fixes:bceaa90240
("inet: prevent leakage of uninitialized memory to user in recv syscalls") Reported-by: Brad Spengler <spender@grsecurity.net> Reported-by: Tom Labanowski Cc: mpb <mpb.mail@gmail.com> Cc: David S. Miller <davem@davemloft.net> Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ca15a078bd
commit
85fbaa7503
@@ -31,7 +31,8 @@
|
||||
|
||||
/* Compatibility glue so we can support IPv6 when it's compiled as a module */
|
||||
struct pingv6_ops {
|
||||
int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len);
|
||||
int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
|
||||
int *addr_len);
|
||||
int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg,
|
||||
struct sk_buff *skb);
|
||||
int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
|
||||
|
Reference in New Issue
Block a user