diff options
author | Jeongjun Park <aha310510@gmail.com> | 2024-08-29 12:56:48 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-08-30 13:26:12 +0100 |
commit | 98d4435efcbf37801a3246fb53856c4b934a2613 (patch) | |
tree | 7a3ade634545fb7666cc762a86f2c3b29746e164 /net/l3mdev | |
parent | 1bb3c548e4e3567749d7313e037a934cbadec8ee (diff) |
net/smc: prevent NULL pointer dereference in txopt_get
Since smc_inet6_prot does not initialize ipv6_pinfo_offset, inet6_create()
copies an incorrect address value, sk + 0 (offset), to inet_sk(sk)->pinet6.
In addition, since inet_sk(sk)->pinet6 and smc_sk(sk)->clcsock practically
point to the same address, when smc_create_clcsk() stores the newly
created clcsock in smc_sk(sk)->clcsock, inet_sk(sk)->pinet6 is corrupted
into clcsock. This causes NULL pointer dereference and various other
memory corruptions.
To solve this problem, you need to initialize ipv6_pinfo_offset, add a
smc6_sock structure, and then add ipv6_pinfo as the second member of
the smc_sock structure.
Reported-by: syzkaller <syzkaller@googlegroups.com>
Fixes: d25a92ccae6b ("net/smc: Introduce IPPROTO_SMC")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l3mdev')
0 files changed, 0 insertions, 0 deletions