milos-linux/drivers
Oliver Hartkopp 8ba68464e4 bonding: refuse to enslave CAN devices
syzbot reported a kernel paging request crash in
can_rx_unregister() inside net/can/af_can.c. The crash occurs
because a virtual CAN device (vxcan) is being enslaved to a
bonding master.

During the enslavement process, the bonding driver mutates
and modifies the network device states to fit an Ethernet-like
aggregation model. However, CAN devices operate on a completely
different Layer 2 architecture, relying on the CAN mid-layer
private data structure (can_ml_priv) instead of standard
Ethernet structures. Since bonding does not initialize or
maintain these CAN structures, subsequent operations on the
half-enslaved interface (such as closing associated sockets
via isotp_release) lead to a null-pointer dereference when
accessing the CAN receiver lists.

Bonding CAN interfaces is architecturally invalid as CAN lacks
MAC addresses, ARP capabilities, and standard Ethernet
link-layer mechanisms. While generic loopback devices are
blocked globally in net/core/dev.c, virtual CAN devices
bypass this check because they do not carry the IFF_LOOPBACK
flag, despite acting as local software-loopbacks.

Fix this by explicitly blocking network devices of type
ARPHRD_CAN from being enslaved at the very beginning of
bond_enslave(). This prevents illegal state mutations,
eliminates the resulting KASAN crashes, and avoids potential
memory leaks from incomplete socket cleanups.

As the CAN support has been added a long time after bonding
the Fixes-tag points to the introduction of ARPHRD_CAN that
would have needed a specific handling in bonding_main.c.

Fixes: cd05acfe65 ("[CAN]: Allocate protocol numbers for PF_CAN")
Reported-by: syzbot+8ed98cbd0161632bce95@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8ed98cbd0161632bce95
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20260526-bonding-candev-v1-1-ba1df400918a@hartkopp.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-27 16:58:28 -07:00
..
accel accel/qaic: Add overflow check to remap_pfn_range during mmap 2026-05-12 10:58:18 -06:00
accessibility
acpi ACPI: driver: Check ACPI_COMPANION() against NULL during probe 2026-05-11 18:50:06 +02:00
amba
android
ata ata: libata-scsi: do not needlessly defer commands when using PMP with FBS 2026-05-18 12:26:51 +02:00
atm
auxdisplay
base drivers/base/memory: fix memory block reference leak in poison accounting 2026-05-13 17:40:03 -07:00
bcma
block rbd: eliminate a race in lock_dwork draining on unmap 2026-05-20 22:09:08 +02:00
bluetooth Bluetooth: hci_uart: fix UAFs and race conditions in close and init paths 2026-05-20 16:35:47 -04:00
bus
cache
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dibs
dio
dma
dma-buf
dpll dpll: zl3073x: fix memory leak on pin registration failure 2026-05-20 19:02:01 -07:00
edac
eisa
extcon
firewire
firmware EFI fixes for v7.1 #2 2026-05-21 08:59:52 -07:00
fpga
fsi
fwctl
gnss
gpib
gpio
gpu drm: Replace old pointer to new idr 2026-05-16 09:32:43 +10:00
greybus
hid HID: core: Fix size_t specifier in hid_report_raw_event() 2026-05-18 13:05:41 -07:00
hsi
hte
hv
hwmon hwmon: (lm90) Add lock protection to lm90_alert 2026-05-16 08:10:33 -07:00
hwspinlock
hwtracing
i2c i2c: smbus: reject oversized block transfers in the common path 2026-05-07 10:59:07 +02:00
i3c
idle
iio
infiniband IB/IPoIB: ndo_set_rx_mode_async conversion 2026-05-15 17:16:33 -07:00
input
interconnect
iommu iommupt: Fix the end_index calculation in __map_range_leaf() 2026-05-15 07:29:16 +02:00
ipack
irqchip irqchip/riscv-imsic: Clear interrupt move state during CPU offlining 2026-05-11 15:23:11 +02:00
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net bonding: refuse to enslave CAN devices 2026-05-27 16:58:28 -07:00
nfc nfc: nxp-nci: i2c: use rising-edge IRQ on ACPI systems 2026-05-18 18:30:36 +02:00
ntb
nubus
nvdimm
nvme nvme-apple: Reset q->sq_tail during queue init 2026-05-14 07:40:35 -07:00
nvmem
of
opp
parisc
parport
pci PCI: Initialize temporary device in new_id_store() 2026-05-08 15:50:06 -05:00
pcmcia
peci
perf
phy
pinctrl
platform platform-drivers-x86 for v7.1-3 2026-05-15 11:12:54 -07:00
pmdomain
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: qcom-rpmh: Fix index for pmh0101 ldo16 2026-05-06 21:26:30 +09:00
remoteproc
resctrl arm_mpam: Check whether the config array is allocated before destroying it 2026-05-14 09:52:05 +01:00
reset
rpmsg
rtc
s390
sbus
scsi SCSI fixes on 20260505 2026-05-05 14:38:31 -07:00
sh
siox
slimbus
soc
soundwire
spi spi: ch341: correct company name in MODULE_DESCRIPTION 2026-05-06 23:09:33 +09:00
spmi
ssb
staging hid-for-linus-2026051401 2026-05-14 14:30:01 -07:00
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb USB serial device ids for 7.1-rc3 2026-05-08 17:18:43 +02:00
vdpa
vfio vfio/pci: Check BAR resources before exporting a DMABUF 2026-05-14 11:39:03 -06:00
vhost
video
virt virt: sev-guest: Do not use host-controlled page order in cleanup path 2026-05-17 11:45:07 -07:00
virtio
w1
watchdog
xen ACPI: PAD: xen: Check ACPI_COMPANION() against NULL 2026-05-12 19:01:37 +02:00
zorro
Kconfig
Makefile