android_kernel_motorola_sm6375/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marcelo Ricardo Leitner a7585028ac sctp: fail if no bound addresses can be used for a given scope
[ Upstream commit 458e279f861d3f61796894cd158b780765a1569f ]

Currently, if you bind the socket to something like:
        servaddr.sin6_family = AF_INET6;
        servaddr.sin6_port = htons(0);
        servaddr.sin6_scope_id = 0;
        inet_pton(AF_INET6, "::1", &servaddr.sin6_addr);

And then request a connect to:
        connaddr.sin6_family = AF_INET6;
        connaddr.sin6_port = htons(20000);
        connaddr.sin6_scope_id = if_nametoindex("lo");
        inet_pton(AF_INET6, "fe88::1", &connaddr.sin6_addr);

What the stack does is:
 - bind the socket
 - create a new asoc
 - to handle the connect
   - copy the addresses that can be used for the given scope
   - try to connect

But the copy returns 0 addresses, and the effect is that it ends up
trying to connect as if the socket wasn't bound, which is not the
desired behavior. This unexpected behavior also allows KASLR leaks
through SCTP diag interface.

The fix here then is, if when trying to copy the addresses that can
be used for the scope used in connect() it returns 0 addresses, bail
out. This is what TCP does with a similar reproducer.

Reported-by: Pietro Borrello <borrello@diag.uniroma1.it>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/9fcd182f1099f86c6661f3717f63712ddd1c676c.1674496737.git.marcelo.leitner@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-06 07:52:46 +01:00
..
6lowpan
9p 9p/xen: check logical size for buffer size 2022-12-14 11:30:41 +01:00
802 mrp: introduce active flags to prevent UAF when applicant uninit 2023-01-18 11:41:37 +01:00
8021q
appletalk
atm net/atm: fix proc_mpc_write incorrect return value 2022-10-29 10:20:35 +02:00
ax25
batman-adv batman-adv: Don't skb_split skbuffs with frag_list 2022-05-18 09:47:24 +02:00
bluetooth Bluetooth: hci_sync: cancel cmd_timer if hci_open failed 2023-02-06 07:52:43 +01:00
bpf bpf: Move skb->len == 0 checks into __bpf_redirect 2023-01-18 11:41:04 +01:00
bpfilter
bridge netfilter: ebtables: fix memory leak when blob is malformed 2022-09-28 11:04:07 +02:00
caif caif: fix memory leak in cfctrl_linkup_request() 2023-01-18 11:41:58 +01:00
can can: af_can: fix NULL pointer dereference in can_rcv_filter 2022-12-14 11:30:44 +01:00
ceph
core net: fix UaF in netns ops registration error path 2023-02-06 07:52:45 +01:00
dcb
dccp dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). 2022-12-08 11:22:59 +01:00
decnet
dns_resolver
dsa net: dsa: ksz: Check return value 2022-12-14 11:30:45 +01:00
ethernet
hsr hsr: Avoid double remove of a node. 2023-01-18 11:41:09 +01:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:56:54 +09:00
ife
ipv4 ipv4: prevent potential spectre v1 gadget in fib_metrics_match() 2023-02-06 07:52:45 +01:00
ipv6 ipv6: raw: Deduct extension header length in rawv6_push_pending_frames 2023-01-18 11:42:02 +01:00
iucv
kcm kcm: close race conditions on sk_receive_queue 2022-11-25 17:42:21 +01:00
key af_key: Fix send_acquire race with pfkey_register 2022-12-08 11:22:57 +01:00
l2tp l2tp: Don't sleep and disable BH under writer-side sk_callback_lock 2023-02-06 07:52:38 +01:00
l3mdev l3mdev: l3mdev_master_upper_ifindex_by_index_rcu should be using netdev_master_upper_dev_get_rcu 2022-04-27 13:50:47 +02:00
lapb
llc
mac80211 wifi: mac80211: Fix ack frame idr leak when mesh has no route 2022-12-08 11:22:57 +01:00
mac802154 mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add() 2022-12-14 11:30:45 +01:00
mpls
ncsi
netfilter netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE 2023-02-06 07:52:46 +01:00
netlabel
netlink netlink: annotate data races around sk_state 2023-02-06 07:52:45 +01:00
netrom netrom: Fix use-after-free of a listening socket. 2023-02-06 07:52:46 +01:00
nfc net: nfc: Fix use-after-free in local_cleanup() 2023-02-06 07:52:37 +01:00
nsh
openvswitch openvswitch: Fix flow lookup to use unmasked key 2023-01-18 11:41:32 +01:00
packet net/af_packet: make sure to pull mac header 2023-01-18 11:41:45 +01:00
phonet
psample
qrtr
rds net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:22:26 +02:00
rfkill
rose rose: Fix NULL pointer dereference in rose_send_frame() 2022-11-10 17:57:51 +01:00
rxrpc rxrpc: Fix missing unlock in rxrpc_do_sendmsg() 2023-01-18 11:41:33 +01:00
sched net/sched: sch_taprio: do not schedule in taprio_reset() 2023-02-06 07:52:46 +01:00
sctp sctp: fail if no bound addresses can be used for a given scope 2023-02-06 07:52:46 +01:00
smc net/smc: Remove redundant refcount increase 2022-09-15 12:04:50 +02:00
strparser
sunrpc SUNRPC: ensure the matching upcall is in-flight upon downcall 2023-01-18 11:41:56 +01:00
switchdev
tipc tipc: call tipc_lxc_xmit without holding node_read_lock 2023-01-18 11:42:06 +01:00
tls net/tls: Fix race in TLS device down flow 2022-07-29 17:14:12 +02:00
unix af_unix: Get user_ns from in_skb in unix_diag_get_exact(). 2022-12-14 11:30:44 +01:00
vmw_vsock net: vmw_vsock: vmci: Check memcpy_from_msg() 2023-01-18 11:41:13 +01:00
wimax
wireless wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails 2023-01-18 11:41:08 +01:00
x25 net/x25: Fix skb leak in x25_lapb_receive_frame() 2022-11-25 17:42:16 +01:00
xdp
xfrm xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:22:49 +02:00
compat.c
Kconfig
Makefile
socket.c net: Fix a data-race around sysctl_somaxconn. 2022-09-05 10:27:42 +02:00
sysctl_net.c