aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2013-11-23 00:46:12 +0100
committerBen Hutchings <ben@decadent.org.uk>2014-01-03 04:33:33 +0000
commitb38ecb9bbbb42b71833ff4439283f51120a35c1a (patch)
tree08180063a39cbadb0d6d22265088254ff40fe6bd /include/net/ip.h
parenta3fd2196b6b82d93dc2878c5291de8014ba61d13 (diff)
downloadkernel_samsung_smdk4412-b38ecb9bbbb42b71833ff4439283f51120a35c1a.zip
kernel_samsung_smdk4412-b38ecb9bbbb42b71833ff4439283f51120a35c1a.tar.gz
kernel_samsung_smdk4412-b38ecb9bbbb42b71833ff4439283f51120a35c1a.tar.bz2
inet: fix addr_len/msg->msg_namelen assignment in recv_error and rxpmtu functions
[ Upstream commit 85fbaa75037d0b6b786ff18658ddf0b4014ce2a4 ] Commit bceaa90240b6019ed73b49965eac7d167610be69 ("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: bceaa90240b6 ("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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 06aed72..b935e6c 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -466,7 +466,7 @@ extern int compat_ip_getsockopt(struct sock *sk, int level,
int optname, char __user *optval, int __user *optlen);
extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *));
-extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len);
+extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len);
extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload);
extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,