Kuniyuki Iwashima
bc5b57a230
netlink: Add __sock_i_ino() for __netlink_diag_dump().
[ Upstream commit 25a9c8a4431c364f97f75558cb346d2ad3f53fbb ]
syzbot reported a warning in __local_bh_enable_ip(). [0]
Commit 8d61f926d420 ("netlink: fix potential deadlock in
netlink_set_err()") converted read_lock(&nl_table_lock) to
read_lock_irqsave() in __netlink_diag_dump() to prevent a deadlock.
However, __netlink_diag_dump() calls sock_i_ino() that uses
read_lock_bh() and read_unlock_bh(). If CONFIG_TRACE_IRQFLAGS=y,
read_unlock_bh() finally enables IRQ even though it should stay
disabled until the following read_unlock_irqrestore().
Using read_lock() in sock_i_ino() would trigger a lockdep splat
in another place that was fixed in commit f064af1e50 ("net: fix
a lockdep splat"), so let's add __sock_i_ino() that would be safe
to use under BH disabled.
[0]:
WARNING: CPU: 0 PID: 5012 at kernel/softirq.c:376 __local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376
Modules linked in:
CPU: 0 PID: 5012 Comm: syz-executor487 Not tainted 6.4.0-rc7-syzkaller-00202-g6f68fc395f49 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:__local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376
Code: 45 bf 01 00 00 00 e8 91 5b 0a 00 e8 3c 15 3d 00 fb 65 8b 05 ec e9 b5 7e 85 c0 74 58 5b 5d c3 65 8b 05 b2 b6 b4 7e 85 c0 75 a2 <0f> 0b eb 9e e8 89 15 3d 00 eb 9f 48 89 ef e8 6f 49 18 00 eb a8 0f
RSP: 0018:ffffc90003a1f3d0 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000201 RCX: 1ffffffff1cf5996
RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8805c6f3
RBP: ffffffff8805c6f3 R08: 0000000000000001 R09: ffff8880152b03a3
R10: ffffed1002a56074 R11: 0000000000000005 R12: 00000000000073e4
R13: dffffc0000000000 R14: 0000000000000002 R15: 0000000000000000
FS: 0000555556726300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000045ad50 CR3: 000000007c646000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
sock_i_ino+0x83/0xa0 net/core/sock.c:2559
__netlink_diag_dump+0x45c/0x790 net/netlink/diag.c:171
netlink_diag_dump+0xd6/0x230 net/netlink/diag.c:207
netlink_dump+0x570/0xc50 net/netlink/af_netlink.c:2269
__netlink_dump_start+0x64b/0x910 net/netlink/af_netlink.c:2374
netlink_dump_start include/linux/netlink.h:329 [inline]
netlink_diag_handler_dump+0x1ae/0x250 net/netlink/diag.c:238
__sock_diag_cmd net/core/sock_diag.c:238 [inline]
sock_diag_rcv_msg+0x31e/0x440 net/core/sock_diag.c:269
netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2547
sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365
netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1914
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg+0xde/0x190 net/socket.c:747
____sys_sendmsg+0x71c/0x900 net/socket.c:2503
___sys_sendmsg+0x110/0x1b0 net/socket.c:2557
__sys_sendmsg+0xf7/0x1c0 net/socket.c:2586
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5303aaabb9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc7506e548 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5303aaabb9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00007f5303a6ed60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5303a6edf0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
Fixes: 8d61f926d420 ("netlink: fix potential deadlock in netlink_set_err()")
Reported-by: [email protected]
Link: https://syzkaller.appspot.com/bug?extid=5da61cf6a9bc1902d422
Suggested-by: Eric Dumazet <[email protected]>
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
|
2023-07-27 08:37:12 +02:00 |
| .. |
|
6lowpan
|
|
|
|
9p
|
9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
|
2023-04-20 12:07:36 +02:00 |
|
802
|
mrp: introduce active flags to prevent UAF when applicant uninit
|
2023-01-18 11:41:37 +01:00 |
|
8021q
|
vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
|
2023-05-30 12:44:06 +01:00 |
|
appletalk
|
|
|
|
atm
|
atm: hide unused procfs functions
|
2023-06-09 10:28:59 +02:00 |
|
ax25
|
|
|
|
batman-adv
|
batman-adv: Broken sync while rescheduling delayed work
|
2023-06-14 10:59:56 +02:00 |
|
bluetooth
|
Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
|
2023-06-14 10:59:58 +02:00 |
|
bpf
|
bpf: Move skb->len == 0 checks into __bpf_redirect
|
2023-01-18 11:41:04 +01:00 |
|
bpfilter
|
|
|
|
bridge
|
netfilter: nftables: add nft_parse_register_store() and use it
|
2023-05-30 12:44:07 +01:00 |
|
caif
|
net: caif: Fix use-after-free in cfusbl_device_notify()
|
2023-03-17 08:32:51 +01:00 |
|
can
|
can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
|
2023-06-14 10:59:57 +02:00 |
|
ceph
|
|
|
|
core
|
netlink: Add __sock_i_ino() for __netlink_diag_dump().
|
2023-07-27 08:37:12 +02:00 |
|
dcb
|
|
|
|
dccp
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
decnet
|
Remove DECnet support from kernel
|
2023-06-21 15:44:10 +02:00 |
|
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
|
|
|
|
ife
|
|
|
|
ipv4
|
xfrm: Linearize the skb after offloading if needed.
|
2023-06-28 10:18:38 +02:00 |
|
ipv6
|
xfrm: Linearize the skb after offloading if needed.
|
2023-06-28 10:18:38 +02:00 |
|
iucv
|
treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()
|
2023-04-20 12:07:32 +02:00 |
|
kcm
|
|
|
|
key
|
af_key: Reject optional tunnel/BEET mode templates in outbound policies
|
2023-05-30 12:44:05 +01:00 |
|
l2tp
|
inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().
|
2023-04-26 11:24:05 +02:00 |
|
l3mdev
|
|
|
|
lapb
|
|
|
|
llc
|
|
|
|
mac80211
|
wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta
|
2023-04-20 12:07:33 +02:00 |
|
mac802154
|
mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add()
|
2022-12-14 11:30:45 +01:00 |
|
mpls
|
net: mpls: fix stale pointer if allocation fails during device rename
|
2023-02-22 12:50:41 +01:00 |
|
ncsi
|
net/ncsi: clear Tx enable mode when handling a Config required AEN
|
2023-05-17 11:35:58 +02:00 |
|
netfilter
|
netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value.
|
2023-07-27 08:37:12 +02:00 |
|
netlabel
|
|
|
|
netlink
|
netlink: Add __sock_i_ino() for __netlink_diag_dump().
|
2023-07-27 08:37:12 +02:00 |
|
netrom
|
netrom: fix info-leak in nr_write_internal()
|
2023-06-09 10:28:52 +02:00 |
|
nfc
|
net: nfc: Fix use-after-free caused by nfc_llcp_find_local
|
2023-07-27 08:37:11 +02:00 |
|
nsh
|
net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
|
2023-05-30 12:44:05 +01:00 |
|
openvswitch
|
net: openvswitch: fix flow memory leak in ovs_flow_cmd_new
|
2023-02-22 12:50:25 +01:00 |
|
packet
|
af_packet: do not use READ_ONCE() in packet_bind()
|
2023-06-09 10:28:53 +02:00 |
|
phonet
|
|
|
|
psample
|
|
|
|
qrtr
|
|
|
|
rds
|
rds: rds_rm_zerocopy_callback() correct order for list_add_tail()
|
2023-03-11 16:43:41 +01:00 |
|
rfkill
|
|
|
|
rose
|
net/rose: Fix to not accept on connected socket
|
2023-02-22 12:50:34 +01:00 |
|
rxrpc
|
rxrpc: Fix hard call timeout units
|
2023-05-17 11:35:59 +02:00 |
|
sched
|
sch_netem: acquire qdisc lock in netem_change()
|
2023-06-28 10:18:40 +02:00 |
|
sctp
|
sctp: fix an error code in sctp_sf_eat_auth()
|
2023-06-21 15:44:11 +02:00 |
|
smc
|
net/smc: fix fallback failed while sendmsg with fastopen
|
2023-03-17 08:32:51 +01:00 |
|
strparser
|
|
|
|
sunrpc
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
switchdev
|
|
|
|
tipc
|
net: tipc: resize nlattr array to correct size
|
2023-06-21 15:44:12 +02:00 |
|
tls
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
unix
|
af_unix: Fix data races around sk->sk_shutdown.
|
2023-05-30 12:44:02 +01:00 |
|
vmw_vsock
|
vsock: avoid to close connected socket after the timeout
|
2023-05-30 12:44:05 +01:00 |
|
wimax
|
|
|
|
wireless
|
wifi: cfg80211: rewrite merging of inherited elements
|
2023-07-27 08:37:10 +02:00 |
|
x25
|
net/x25: Fix to not accept on connected socket
|
2023-02-22 12:50:26 +01:00 |
|
xdp
|
|
|
|
xfrm
|
xfrm: Check if_id in inbound policy/secpath match
|
2023-06-09 10:28:56 +02:00 |
|
compat.c
|
|
|
|
Kconfig
|
Remove DECnet support from kernel
|
2023-06-21 15:44:10 +02:00 |
|
Makefile
|
Remove DECnet support from kernel
|
2023-06-21 15:44:10 +02:00 |
|
socket.c
|
net: annotate sk->sk_err write from do_recvmmsg()
|
2023-05-30 12:44:01 +01:00 |
|
sysctl_net.c
|
|
|