linux-stable/net
Hyunwoo Kim 6186abddb2 net/x25: Fix to not accept on connected socket
[ Upstream commit f2b0b5210f ]

When listen() and accept() are called on an x25 socket
that connect() succeeds, accept() succeeds immediately.
This is because x25_connect() queues the skb to
sk->sk_receive_queue, and x25_accept() dequeues it.

This creates a child socket with the sk of the parent
x25 socket, which can cause confusion.

Fix x25_listen() to return -EINVAL if the socket has
already been successfully connect()ed to avoid this issue.

Signed-off-by: Hyunwoo Kim <v4bel@theori.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-22 12:46:02 +01:00
..
6lowpan 6lowpan: Off by one handling ->nexthdr 2020-01-27 14:46:30 +01:00
9p net/9p: Fix a potential socket leak in p9_socket_open 2022-12-08 11:16:32 +01:00
802 mrp: introduce active flags to prevent UAF when applicant uninit 2023-01-18 09:26:32 +01:00
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-01-17 13:58:58 +01:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-04-07 12:47:02 +02:00
atm net/atm: fix proc_mpc_write incorrect return value 2022-11-03 23:50:51 +09:00
ax25 ax25: Fix UAF bugs in ax25 timers 2022-04-27 13:15:32 +02:00
batman-adv batman-adv: Don't skb_split skbuffs with frag_list 2022-05-18 09:18:05 +02:00
bluetooth Bluetooth: hci_sync: cancel cmd_timer if hci_open failed 2023-02-06 07:46:30 +01:00
bpf bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() 2022-11-25 17:36:54 +01:00
bridge netfilter: ebtables: fix memory leak when blob is malformed 2022-09-28 10:56:51 +02:00
caif caif: fix memory leak in cfctrl_linkup_request() 2023-01-18 09:26:41 +01:00
can can: bcm: check the result of can_send() in bcm_can_tx() 2022-10-26 13:17:10 +02:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2020-11-05 11:07:03 +01:00
core net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats 2023-01-24 07:05:18 +01:00
dcb net: dcb: disable softirqs in dcbnl_flush_dev() 2022-03-08 19:01:58 +01:00
dccp dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). 2022-12-08 11:16:30 +01:00
decnet net: decnet: Fix sleeping inside in af_decnet 2021-07-28 11:12:18 +02:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2020-04-24 08:01:25 +02:00
dsa net: dsa: Fix duplicate frames flooded by learning 2020-04-02 16:34:24 +02:00
ethernet net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:17:59 +01:00
hsr net: hsr: Fix potential use-after-free 2022-12-08 11:16:32 +01:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:50:54 +09:00
ife
ipv4 net/ulp: prevent ULP without clone op from entering the LISTEN status 2023-01-18 09:26:42 +01:00
ipv6 ipv6: ensure sane device mtu in tunnels 2023-02-06 07:46:35 +01:00
ipx
iucv net/af_iucv: set correct sk_protocol for child sockets 2020-12-08 10:17:32 +01:00
kcm kcm: close race conditions on sk_receive_queue 2022-11-25 17:36:54 +01:00
key af_key: Fix send_acquire race with pfkey_register 2022-12-08 11:16:29 +01:00
l2tp l2tp: fix race in pppol2tp_release with session object destroy 2022-06-25 11:46:45 +02:00
l3mdev
lapb net: lapb: Copy the skb before sending a packet 2021-02-10 09:12:08 +01:00
llc llc: only change llc->dev when bind() succeeds 2022-03-28 08:22:27 +02:00
mac80211 wifi: mac80211: Fix ack frame idr leak when mesh has no route 2022-12-08 11:16:29 +01:00
mac802154 mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add() 2022-12-14 11:26:14 +01:00
mpls net: mpls: Fix notifications when deleting a device 2021-12-08 08:46:55 +01:00
ncsi net/ncsi: Avoid GFP_KERNEL in response handler 2021-04-16 11:57:51 +02:00
netfilter netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE 2023-02-06 07:46:31 +01:00
netlabel net: fix NULL pointer reference in cipso_v4_doi_free 2021-09-22 11:45:32 +02:00
netlink netlink: annotate data races around sk_state 2023-02-06 07:46:31 +01:00
netrom netrom: Fix use-after-free caused by accept on already connected socket 2023-02-22 12:46:01 +01:00
nfc net: nfc: Fix use-after-free in local_cleanup() 2023-02-06 07:46:28 +01:00
nsh
openvswitch net: openvswitch: fix flow memory leak in ovs_flow_cmd_new 2023-02-22 12:46:01 +01:00
packet packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE 2022-12-08 11:16:32 +01:00
phonet phonet: refcount leak in pep_sock_accep 2022-01-11 13:57:37 +01:00
psample net: psample: fix skb_over_panic 2019-12-05 15:38:15 +01:00
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-03-30 14:40:12 +02:00
rds net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:17:00 +02:00
rfkill rfkill: Fix incorrect check to avoid NULL pointer dereference 2020-01-12 12:11:57 +01:00
rose rose: Fix NULL pointer dereference in rose_send_frame() 2022-11-10 15:47:21 +01:00
rxrpc rxrpc: Don't try to resend the request if we're receiving the reply 2022-06-14 16:53:50 +02:00
sched net: sched: disallow noqueue for qdisc classes 2023-01-18 09:26:42 +01:00
sctp sctp: do not check hb_timer.expires when resetting hb_timer 2023-02-22 12:46:01 +01:00
smc net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending 2022-05-18 09:18:06 +02:00
strparser
sunrpc SUNRPC: ensure the matching upcall is in-flight upon downcall 2023-01-18 09:26:40 +01:00
switchdev
tipc tipc: Fix potential OOB in tipc_link_proto_rcv() 2022-12-14 11:26:15 +01:00
tls
unix af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress 2022-01-27 09:01:00 +01:00
vmw_vsock net: vmw_vsock: vmci: Check memcpy_from_msg() 2023-01-18 09:26:18 +01:00
wimax
wireless wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() 2022-09-15 12:23:49 +02:00
x25 net/x25: Fix to not accept on connected socket 2023-02-22 12:46:02 +01:00
xfrm xfrm: Update ipcomp_scratches with NULL when freed 2022-10-26 13:17:09 +02:00
compat.c net: Return the correct errno code 2021-06-30 08:48:47 -04:00
Kconfig
Makefile net: split out functions related to registering inflight socket files 2021-08-04 12:22:14 +02:00
socket.c net: Fix a data-race around sysctl_somaxconn. 2022-09-05 10:25:04 +02:00
sysctl_net.c