Eric Dumazet
f58328d7d3
llc: make sure applications use ARPHRD_ETHER
[ Upstream commit a9b1110162357689a34992d5c925852948e5b9fd ]
syzbot was to trigger a bug by tricking AF_LLC with
non sensible addr->sllc_arphrd
It seems clear LLC requires an Ethernet device.
Back in commit abf9d537fe ("llc: add support for SO_BINDTODEVICE")
Octavian Purdila added possibility for application to use a zero
value for sllc_arphrd, convert it to ARPHRD_ETHER to not cause
regressions on existing applications.
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:199 [inline]
BUG: KASAN: use-after-free in list_empty include/linux/list.h:268 [inline]
BUG: KASAN: use-after-free in waitqueue_active include/linux/wait.h:126 [inline]
BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:160 [inline]
BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2092 [inline]
BUG: KASAN: use-after-free in sock_def_write_space+0x642/0x670 net/core/sock.c:2813
Read of size 8 at addr ffff88801e0b4078 by task ksoftirqd/3/27
CPU: 3 PID: 27 Comm: ksoftirqd/3 Not tainted 5.5.0-rc1-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x197/0x210 lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
__kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506
kasan_report+0x12/0x20 mm/kasan/common.c:639
__asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135
__read_once_size include/linux/compiler.h:199 [inline]
list_empty include/linux/list.h:268 [inline]
waitqueue_active include/linux/wait.h:126 [inline]
wq_has_sleeper include/linux/wait.h:160 [inline]
skwq_has_sleeper include/net/sock.h:2092 [inline]
sock_def_write_space+0x642/0x670 net/core/sock.c:2813
sock_wfree+0x1e1/0x260 net/core/sock.c:1958
skb_release_head_state+0xeb/0x260 net/core/skbuff.c:652
skb_release_all+0x16/0x60 net/core/skbuff.c:663
__kfree_skb net/core/skbuff.c:679 [inline]
consume_skb net/core/skbuff.c:838 [inline]
consume_skb+0xfb/0x410 net/core/skbuff.c:832
__dev_kfree_skb_any+0xa4/0xd0 net/core/dev.c:2967
dev_kfree_skb_any include/linux/netdevice.h:3650 [inline]
e1000_unmap_and_free_tx_resource.isra.0+0x21b/0x3a0 drivers/net/ethernet/intel/e1000/e1000_main.c:1963
e1000_clean_tx_irq drivers/net/ethernet/intel/e1000/e1000_main.c:3854 [inline]
e1000_clean+0x4cc/0x1d10 drivers/net/ethernet/intel/e1000/e1000_main.c:3796
napi_poll net/core/dev.c:6532 [inline]
net_rx_action+0x508/0x1120 net/core/dev.c:6600
__do_softirq+0x262/0x98c kernel/softirq.c:292
run_ksoftirqd kernel/softirq.c:603 [inline]
run_ksoftirqd+0x8e/0x110 kernel/softirq.c:595
smpboot_thread_fn+0x6a3/0xa40 kernel/smpboot.c:165
kthread+0x361/0x430 kernel/kthread.c:255
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
Allocated by task 8247:
save_stack+0x23/0x90 mm/kasan/common.c:72
set_track mm/kasan/common.c:80 [inline]
__kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486
kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:521
slab_post_alloc_hook mm/slab.h:584 [inline]
slab_alloc mm/slab.c:3320 [inline]
kmem_cache_alloc+0x121/0x710 mm/slab.c:3484
sock_alloc_inode+0x1c/0x1d0 net/socket.c:240
alloc_inode+0x68/0x1e0 fs/inode.c:230
new_inode_pseudo+0x19/0xf0 fs/inode.c:919
sock_alloc+0x41/0x270 net/socket.c:560
__sock_create+0xc2/0x730 net/socket.c:1384
sock_create net/socket.c:1471 [inline]
__sys_socket+0x103/0x220 net/socket.c:1513
__do_sys_socket net/socket.c:1522 [inline]
__se_sys_socket net/socket.c:1520 [inline]
__ia32_sys_socket+0x73/0xb0 net/socket.c:1520
do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline]
do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408
entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
Freed by task 17:
save_stack+0x23/0x90 mm/kasan/common.c:72
set_track mm/kasan/common.c:80 [inline]
kasan_set_free_info mm/kasan/common.c:335 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/common.c:474
kasan_slab_free+0xe/0x10 mm/kasan/common.c:483
__cache_free mm/slab.c:3426 [inline]
kmem_cache_free+0x86/0x320 mm/slab.c:3694
sock_free_inode+0x20/0x30 net/socket.c:261
i_callback+0x44/0x80 fs/inode.c:219
__rcu_reclaim kernel/rcu/rcu.h:222 [inline]
rcu_do_batch kernel/rcu/tree.c:2183 [inline]
rcu_core+0x570/0x1540 kernel/rcu/tree.c:2408
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2417
__do_softirq+0x262/0x98c kernel/softirq.c:292
The buggy address belongs to the object at ffff88801e0b4000
which belongs to the cache sock_inode_cache of size 1152
The buggy address is located 120 bytes inside of
1152-byte region [ffff88801e0b4000, ffff88801e0b4480)
The buggy address belongs to the page:
page:ffffea0000782d00 refcount:1 mapcount:0 mapping:ffff88807aa59c40 index:0xffff88801e0b4ffd
raw: 00fffe0000000200 ffffea00008e6c88 ffffea0000782d48 ffff88807aa59c40
raw: ffff88801e0b4ffd ffff88801e0b4000 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88801e0b3f00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff88801e0b3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801e0b4000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801e0b4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801e0b4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Fixes: abf9d537fe ("llc: add support for SO_BINDTODEVICE")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2020-07-22 09:31:59 +02:00 |
| .. |
|
6lowpan
|
6lowpan: Off by one handling ->nexthdr
|
2020-01-27 14:50:41 +01:00 |
|
9p
|
9p: Transport error uninitialized
|
2019-10-11 18:21:12 +02:00 |
|
802
|
|
|
|
8021q
|
vlan: vlan_changelink() should propagate errors
|
2020-01-12 12:17:28 +01:00 |
|
appletalk
|
appletalk: Set error code if register_snap_client failed
|
2019-12-13 08:52:59 +01:00 |
|
atm
|
net: use skb_queue_empty_lockless() in poll() handlers
|
2019-11-10 11:27:48 +01:00 |
|
ax25
|
ax25: fix setsockopt(SO_BINDTODEVICE)
|
2020-06-03 08:19:02 +02:00 |
|
batman-adv
|
batman-adv: Revert "disable ethtool link speed detection when auto negotiation off"
|
2020-06-22 09:05:12 +02:00 |
|
bluetooth
|
Bluetooth: Add SCO fallback for invalid LMP parameters error
|
2020-06-22 09:05:11 +02:00 |
|
bpf
|
bpf/test_run: support cgroup local storage
|
2018-08-03 00:47:32 +02:00 |
|
bpfilter
|
signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig
|
2020-01-27 14:50:51 +01:00 |
|
bridge
|
net: bridge: enfore alignment for ethernet address
|
2020-06-30 23:17:03 -04:00 |
|
caif
|
net: use skb_queue_empty_lockless() in poll() handlers
|
2019-11-10 11:27:48 +01:00 |
|
can
|
can: gw: Fix error path of cgw_module_init
|
2019-08-29 08:28:30 +02:00 |
|
ceph
|
libceph: ignore pool overlay and cache logic on redirects
|
2020-06-03 08:19:39 +02:00 |
|
core
|
bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok()
|
2020-07-16 08:17:27 +02:00 |
|
dcb
|
net: dcb: Add priority-to-DSCP map getters
|
2018-07-27 13:17:50 -07:00 |
|
dccp
|
net: ipv6: add net argument to ip6_dst_lookup_flow
|
2020-04-29 16:31:16 +02:00 |
|
decnet
|
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
|
2020-01-04 19:13:37 +01:00 |
|
dns_resolver
|
KEYS: Don't write out to userspace while holding key semaphore
|
2020-04-23 10:30:24 +02:00 |
|
dsa
|
net: dsa: mt7530: fix roaming from DSA user ports
|
2020-06-03 08:19:03 +02:00 |
|
ethernet
|
net: add annotations on hh->hh_len lockless accesses
|
2020-01-09 10:19:09 +01:00 |
|
hsr
|
hsr: check protocol version in hsr_newlink()
|
2020-04-21 09:03:03 +02:00 |
|
ieee802154
|
nl802154: add missing attribute validation for dev_type
|
2020-03-18 07:14:15 +01:00 |
|
ife
|
|
|
|
ipv4
|
ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg
|
2020-07-22 09:31:59 +02:00 |
|
ipv6
|
ip6_gre: fix use-after-free in ip6gre_tunnel_lookup()
|
2020-06-30 23:17:05 -04:00 |
|
iucv
|
net/af_iucv: always register net_device notifier
|
2020-01-27 14:50:56 +01:00 |
|
kcm
|
kcm: switch order of device registration to fix a crash
|
2019-04-17 08:38:40 +02:00 |
|
key
|
af_key: fix leaks in key_pol_get_resp and dump_sp.
|
2019-07-26 09:14:01 +02:00 |
|
l2tp
|
l2tp: remove skb_dst_set() from l2tp_xmit_skb()
|
2020-07-22 09:31:59 +02:00 |
|
l3mdev
|
|
|
|
lapb
|
lapb: fixed leak of control-blocks.
|
2019-06-22 08:15:13 +02:00 |
|
llc
|
llc: make sure applications use ARPHRD_ETHER
|
2020-07-22 09:31:59 +02:00 |
|
mac80211
|
mac80211: mesh: fix discovery timer re-arming issue / crash
|
2020-06-03 08:19:43 +02:00 |
|
mac802154
|
net: mac802154: tx: expand tailroom if necessary
|
2018-08-06 11:21:37 +02:00 |
|
mpls
|
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
|
2020-04-29 16:31:17 +02:00 |
|
ncsi
|
net/ncsi: Fixup .dumpit message flags and ID check in Netlink handler
|
2018-08-22 21:39:08 -07:00 |
|
netfilter
|
netfilter: ipset: fix unaligned atomic access
|
2020-06-30 23:17:12 -04:00 |
|
netlabel
|
netlabel: cope with NULL catmap
|
2020-05-20 08:18:35 +02:00 |
|
netlink
|
genetlink: remove genl_bind
|
2020-07-22 09:31:58 +02:00 |
|
netrom
|
net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node
|
2020-04-29 16:31:21 +02:00 |
|
nfc
|
nfc: add missing attribute validation for vendor subcommand
|
2020-03-18 07:14:17 +01:00 |
|
nsh
|
nsh: set mac len based on inner packet
|
2018-07-12 16:55:29 -07:00 |
|
openvswitch
|
openvswitch: support asymmetric conntrack
|
2019-12-21 10:57:14 +01:00 |
|
packet
|
net/packet: tpacket_rcv: avoid a producer race condition
|
2020-04-02 15:28:11 +02:00 |
|
phonet
|
net: use skb_queue_empty_lockless() in poll() handlers
|
2019-11-10 11:27:48 +01:00 |
|
psample
|
net: psample: fix skb_over_panic
|
2019-12-05 09:21:30 +01:00 |
|
qrtr
|
net: qrtr: Fix an out of bounds read qrtr_endpoint_post()
|
2020-07-16 08:17:23 +02:00 |
|
rds
|
net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names'
|
2020-01-27 14:51:13 +01:00 |
|
rfkill
|
rfkill: Fix incorrect check to avoid NULL pointer dereference
|
2020-01-12 12:17:17 +01:00 |
|
rose
|
net/rose: fix unbound loop in rose_loopback_timer()
|
2019-05-02 09:59:00 +02:00 |
|
rxrpc
|
rxrpc: Fix handling of rwind from an ACK packet
|
2020-06-30 23:17:11 -04:00 |
|
sched
|
sch_cake: don't call diffserv parsing code when it is not needed
|
2020-06-30 23:17:06 -04:00 |
|
sctp
|
sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket
|
2020-06-30 23:17:05 -04:00 |
|
smc
|
net/smc: cancel event worker during device removal
|
2020-03-18 07:14:25 +01:00 |
|
strparser
|
net: strparser: partially revert "strparser: Call skb_unclone conditionally"
|
2019-05-16 19:41:27 +02:00 |
|
sunrpc
|
SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment()
|
2020-06-30 23:17:18 -04:00 |
|
switchdev
|
|
|
|
tipc
|
tipc: fix partial topology connection closure
|
2020-05-14 07:57:18 +02:00 |
|
tls
|
net/tls: Fix to avoid gettig invalid tls record
|
2020-03-05 16:42:17 +01:00 |
|
unix
|
af_unix: add compat_ioctl support
|
2020-01-17 19:47:07 +01:00 |
|
vmw_vsock
|
vsock: fix timeout in vsock_accept()
|
2020-06-10 21:34:59 +02:00 |
|
wimax
|
wimax: remove blank lines at EOF
|
2018-07-24 14:10:42 -07:00 |
|
wireless
|
nl80211: fix NL80211_ATTR_CHANNEL_WIDTH attribute type
|
2020-04-02 15:28:17 +02:00 |
|
x25
|
net/x25: Fix x25_neigh refcnt leak when receiving frame
|
2020-04-29 16:31:21 +02:00 |
|
xdp
|
xdp: Fix xsk_generic_xmit errno
|
2020-06-25 15:33:05 +02:00 |
|
xfrm
|
xfrm: Fix double ESP trailer insertion in IPsec crypto offload.
|
2020-06-30 23:17:10 -04:00 |
|
compat.c
|
sock: Make sock->sk_stamp thread-safe
|
2019-01-09 17:38:33 +01:00 |
|
Kconfig
|
net: remove blank lines at end of file
|
2018-07-24 14:10:43 -07:00 |
|
Makefile
|
bpfilter: check compiler capability in Kconfig
|
2018-06-28 13:36:39 +09:00 |
|
socket.c
|
compat_ioctl: handle SIOCOUTQNSD
|
2020-01-17 19:47:07 +01:00 |
|
sysctl_net.c
|
|
|