Skip to content

Commit fe3d42f

Browse files
committed
ipv6: Fix potential uninit-value access in __ip6_make_skb()
jira LE-1907 cve CVE-2024-36903 Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4 commit-author Shigeru Yoshida <syoshida@redhat.com> commit 4e13d3a Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-5.14.0-427.31.1.el9_4/4e13d3a9.failed As it was done in commit fc1092f ("ipv4: Fix uninit-value access in __ip_make_skb()") for IPv4, check FLOWI_FLAG_KNOWN_NH on fl6->flowi6_flags instead of testing HDRINCL on the socket to avoid a race condition which causes uninit-value access. Fixes: ea30388 ("ipv6: Fix an uninit variable access bug in __ip6_make_skb()") Signed-off-by: Shigeru Yoshida <syoshida@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 4e13d3a) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # net/ipv6/ip6_output.c
1 parent 51d3474 commit fe3d42f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
ipv6: Fix potential uninit-value access in __ip6_make_skb()
2+
3+
jira LE-1907
4+
cve CVE-2024-36903
5+
Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4
6+
commit-author Shigeru Yoshida <syoshida@redhat.com>
7+
commit 4e13d3a9c25b7080f8a619f961e943fe08c2672c
8+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
9+
Will be included in final tarball splat. Ref for failed cherry-pick at:
10+
ciq/ciq_backports/kernel-5.14.0-427.31.1.el9_4/4e13d3a9.failed
11+
12+
As it was done in commit fc1092f51567 ("ipv4: Fix uninit-value access in
13+
__ip_make_skb()") for IPv4, check FLOWI_FLAG_KNOWN_NH on fl6->flowi6_flags
14+
instead of testing HDRINCL on the socket to avoid a race condition which
15+
causes uninit-value access.
16+
17+
Fixes: ea30388baebc ("ipv6: Fix an uninit variable access bug in __ip6_make_skb()")
18+
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
19+
Signed-off-by: David S. Miller <davem@davemloft.net>
20+
(cherry picked from commit 4e13d3a9c25b7080f8a619f961e943fe08c2672c)
21+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
22+
23+
# Conflicts:
24+
# net/ipv6/ip6_output.c
25+
diff --cc net/ipv6/ip6_output.c
26+
index 282ce383927c,fa2937732665..000000000000
27+
--- a/net/ipv6/ip6_output.c
28+
+++ b/net/ipv6/ip6_output.c
29+
@@@ -1968,7 -1932,8 +1968,12 @@@ struct sk_buff *__ip6_make_skb(struct s
30+
struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb));
31+
u8 icmp6_type;
32+
33+
++<<<<<<< HEAD
34+
+ if (sk->sk_socket->type == SOCK_RAW && !inet_sk(sk)->hdrincl)
35+
++=======
36+
+ if (sk->sk_socket->type == SOCK_RAW &&
37+
+ !(fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH))
38+
++>>>>>>> 4e13d3a9c25b (ipv6: Fix potential uninit-value access in __ip6_make_skb())
39+
icmp6_type = fl6->fl6_icmp_type;
40+
else
41+
icmp6_type = icmp6_hdr(skb)->icmp6_type;
42+
* Unmerged path net/ipv6/ip6_output.c

0 commit comments

Comments
 (0)