diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 4 | ||||
-rw-r--r-- | net/ipv6/udp.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 0302e0eb07af..7178e32eb15d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2330,6 +2330,10 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk, | |||
2330 | 2330 | ||
2331 | rcu_read_lock(); | 2331 | rcu_read_lock(); |
2332 | from = rcu_dereference(rt6->from); | 2332 | from = rcu_dereference(rt6->from); |
2333 | if (!from) { | ||
2334 | rcu_read_unlock(); | ||
2335 | return; | ||
2336 | } | ||
2333 | nrt6 = ip6_rt_cache_alloc(from, daddr, saddr); | 2337 | nrt6 = ip6_rt_cache_alloc(from, daddr, saddr); |
2334 | if (nrt6) { | 2338 | if (nrt6) { |
2335 | rt6_do_update_pmtu(nrt6, mtu); | 2339 | rt6_do_update_pmtu(nrt6, mtu); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index b444483cdb2b..622eeaf5732b 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1047,6 +1047,8 @@ static void udp_v6_flush_pending_frames(struct sock *sk) | |||
1047 | static int udpv6_pre_connect(struct sock *sk, struct sockaddr *uaddr, | 1047 | static int udpv6_pre_connect(struct sock *sk, struct sockaddr *uaddr, |
1048 | int addr_len) | 1048 | int addr_len) |
1049 | { | 1049 | { |
1050 | if (addr_len < offsetofend(struct sockaddr, sa_family)) | ||
1051 | return -EINVAL; | ||
1050 | /* The following checks are replicated from __ip6_datagram_connect() | 1052 | /* The following checks are replicated from __ip6_datagram_connect() |
1051 | * and intended to prevent BPF program called below from accessing | 1053 | * and intended to prevent BPF program called below from accessing |
1052 | * bytes that are out of the bound specified by user in addr_len. | 1054 | * bytes that are out of the bound specified by user in addr_len. |