linux-stable/drivers
Xuan Zhuo 5c37711d9f virtio-net: fix for unable to handle page fault for address
In merge mode, when xdp is enabled, if the headroom of buf is smaller
than virtnet_get_headroom(), xdp_linearize_page() will be called but the
variable of "headroom" is still 0, which leads to wrong logic after
entering page_to_skb().

[   16.600944] BUG: unable to handle page fault for address: ffffecbfff7b43c8[   16.602175] #PF: supervisor read access in kernel mode
[   16.603350] #PF: error_code(0x0000) - not-present page
[   16.604200] PGD 0 P4D 0
[   16.604686] Oops: 0000 [#1] SMP PTI
[   16.605306] CPU: 4 PID: 715 Comm: sh Tainted: G    B             5.12.0+ #312
[   16.606429] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/04
[   16.608217] RIP: 0010:unmap_page_range+0x947/0xde0
[   16.609014] Code: 00 00 08 00 48 83 f8 01 45 19 e4 41 f7 d4 41 83 e4 03 e9 a4 fd ff ff e8 b7 63 ed ff 4c 89 e0 48 c1 e0 065
[   16.611863] RSP: 0018:ffffc90002503c58 EFLAGS: 00010286
[   16.612720] RAX: ffffecbfff7b43c0 RBX: 00007f19f7203000 RCX: ffffffff812ff359
[   16.613853] RDX: ffff888107778000 RSI: 0000000000000000 RDI: 0000000000000005
[   16.614976] RBP: ffffea000425e000 R08: 0000000000000000 R09: 3030303030303030
[   16.616124] R10: ffffffff82ed7d94 R11: 6637303030302052 R12: 7c00000afffded0f
[   16.617276] R13: 0000000000000001 R14: ffff888119ee7010 R15: 00007f19f7202000
[   16.618423] FS:  0000000000000000(0000) GS:ffff88842fd00000(0000) knlGS:0000000000000000
[   16.619738] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   16.620670] CR2: ffffecbfff7b43c8 CR3: 0000000103220005 CR4: 0000000000370ee0
[   16.621792] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   16.622920] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   16.624047] Call Trace:
[   16.624525]  ? release_pages+0x24d/0x730
[   16.625209]  unmap_single_vma+0xa9/0x130
[   16.625885]  unmap_vmas+0x76/0xf0
[   16.626480]  exit_mmap+0xa0/0x210
[   16.627129]  mmput+0x67/0x180
[   16.627673]  do_exit+0x3d1/0xf10
[   16.628259]  ? do_user_addr_fault+0x231/0x840
[   16.629000]  do_group_exit+0x53/0xd0
[   16.629631]  __x64_sys_exit_group+0x1d/0x20
[   16.630354]  do_syscall_64+0x3c/0x80
[   16.630988]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[   16.631828] RIP: 0033:0x7f1a043d0191
[   16.632464] Code: Unable to access opcode bytes at RIP 0x7f1a043d0167.
[   16.633502] RSP: 002b:00007ffe3d993308 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[   16.634737] RAX: ffffffffffffffda RBX: 00007f1a044c9490 RCX: 00007f1a043d0191
[   16.635857] RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
[   16.636986] RBP: 0000000000000000 R08: ffffffffffffff88 R09: 0000000000000001
[   16.638120] R10: 0000000000000008 R11: 0000000000000246 R12: 00007f1a044c9490
[   16.639245] R13: 0000000000000001 R14: 00007f1a044c9968 R15: 0000000000000000
[   16.640408] Modules linked in:
[   16.640958] CR2: ffffecbfff7b43c8
[   16.641557] ---[ end trace bc4891c6ce46354c ]---
[   16.642335] RIP: 0010:unmap_page_range+0x947/0xde0
[   16.643135] Code: 00 00 08 00 48 83 f8 01 45 19 e4 41 f7 d4 41 83 e4 03 e9 a4 fd ff ff e8 b7 63 ed ff 4c 89 e0 48 c1 e0 065
[   16.645983] RSP: 0018:ffffc90002503c58 EFLAGS: 00010286
[   16.646845] RAX: ffffecbfff7b43c0 RBX: 00007f19f7203000 RCX: ffffffff812ff359
[   16.647970] RDX: ffff888107778000 RSI: 0000000000000000 RDI: 0000000000000005
[   16.649091] RBP: ffffea000425e000 R08: 0000000000000000 R09: 3030303030303030
[   16.650250] R10: ffffffff82ed7d94 R11: 6637303030302052 R12: 7c00000afffded0f
[   16.651394] R13: 0000000000000001 R14: ffff888119ee7010 R15: 00007f19f7202000
[   16.652529] FS:  0000000000000000(0000) GS:ffff88842fd00000(0000) knlGS:0000000000000000
[   16.653887] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   16.654841] CR2: ffffecbfff7b43c8 CR3: 0000000103220005 CR4: 0000000000370ee0
[   16.655992] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   16.657150] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   16.658290] Kernel panic - not syncing: Fatal exception
[   16.659613] Kernel Offset: disabled
[   16.660234] ---[ end Kernel panic - not syncing: Fatal exception ]---

Fixes: fb32856b16 ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom")
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-01 15:24:11 -07:00
..
accessibility
acpi libnvdimm fixes for 5.13-rc2 2021-05-15 08:32:51 -07:00
amba
android binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION 2021-05-13 20:35:26 +02:00
ata pci-v5.13-changes 2021-05-05 13:24:11 -07:00
atm atm: firestream: Use fallthrough pseudo-keyword 2021-05-07 16:01:08 -07:00
auxdisplay treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
base Driver core fixes for 5.13-rc2 2021-05-16 10:13:14 -07:00
bcma
block block-5.13-2021-05-14 2021-05-15 08:52:30 -07:00
bluetooth
bus
cdrom cdrom: gdrom: initialize global variable at init time 2021-05-13 18:58:44 +02:00
char Char/misc driver fixes for 5.13-rc3 2021-05-20 06:31:52 -10:00
clk clk: Skip clk provider registration when np is NULL 2021-05-11 08:47:25 +02:00
clocksource clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86 2021-05-14 14:55:13 +02:00
comedi
connector
counter
cpufreq Fix an idle CPU selection bug, and an AMD Ryzen maximum frequency enumeration bug. 2021-05-15 10:24:48 -07:00
cpuidle
crypto Revert "crypto: cavium/nitrox - add an error message to explain the failure of pci_request_mem_regions" 2021-05-13 17:23:05 +02:00
cxl
dax
dca
devfreq
dio
dma dmaengine: qcom_hidma: comment platform_driver_register call 2021-05-13 18:32:29 +02:00
dma-buf dma-buf: fix unintended pin/unpin warnings 2021-05-20 14:02:27 +02:00
edac x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG 2021-05-10 07:51:38 +02:00
eisa
extcon
firewire
firmware ARM: SoC fixes for 5.13 2021-05-20 14:46:26 -10:00
fpga
fsi
gnss
gpio gpio: tegra186: Don't set parent IRQ affinity 2021-05-12 13:56:43 +02:00
gpu drm fixes for 5.13-rc3 2021-05-20 20:15:43 -10:00
greybus
hid
hsi
hv
hwmon Char/misc driver fixes for 5.13-rc3 2021-05-20 06:31:52 -10:00
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio iio: tsl2583: Fix division by a zero lux_val 2021-05-10 14:01:48 +01:00
infiniband Networking fixes for 5.13-rc4, including fixes from bpf, netfilter, 2021-05-26 17:44:49 -10:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-05-06 23:37:55 -07:00
interconnect
iommu pci-v5.13-changes 2021-05-05 13:24:11 -07:00
ipack
irqchip irqchip: Remove redundant error printing 2021-05-16 13:07:18 +01:00
isdn Networking fixes for 5.13-rc4, including fixes from bpf, netfilter, 2021-05-26 17:44:49 -10:00
leds leds: lp5523: check return value of lp5xx_read and jump to cleanup code 2021-05-13 17:30:15 +02:00
lightnvm
macintosh
mailbox
mcb
md dm integrity: fix sparse warnings 2021-05-13 14:53:49 -04:00
media media: gspca: properly check for errors in po1030_probe() 2021-05-13 18:58:32 +02:00
memory
memstick
message
mfd
misc platform-drivers-x86 for v5.13-2 2021-05-20 06:40:20 -10:00
mmc mmc: sdhci-pci-gli: increase 1.8V regulator wait 2021-05-10 14:39:06 +02:00
most
mtd mtd: parsers: ofpart: fix parsing subpartitions 2021-05-10 18:34:30 +02:00
mux
net virtio-net: fix for unable to handle page fault for address 2021-06-01 15:24:11 -07:00
nfc NFC: nfcmrvl: fix kernel-doc syntax in file headers 2021-05-23 17:26:38 -07:00
ntb
nubus
nvdimm include: remove pagemap.h from blkdev.h 2021-05-06 19:24:11 -07:00
nvme nvme-fc: clear q_live at beginning of association teardown 2021-05-19 08:40:24 +02:00
nvmem
of
opp
parisc
parport treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
pci more s390 updates for 5.13 merge window 2021-05-06 14:39:50 -07:00
pcmcia
perf
phy
pinctrl linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> 2021-05-09 00:29:45 +09:00
platform platform/x86: touchscreen_dmi: Add info for the Chuwi Hi10 Pro (CWI529) tablet 2021-05-20 14:11:03 +02:00
pnp
power
powercap
pps
ps3
ptp ptp: ocp: Fix a resource leak in an error handling path 2021-05-12 14:06:33 -07:00
pwm pwm: Changes for v5.13-rc1 2021-05-05 12:53:16 -07:00
rapidio rapidio: handle create_workqueue() failure 2021-05-13 18:32:19 +02:00
ras
regulator
remoteproc
reset pci-v5.13-changes 2021-05-05 13:24:11 -07:00
rpmsg
rtc
s390 block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
sbus
scsi SCSI fixes on 20210520 2021-05-20 14:41:35 -10:00
sh
siox
slimbus
soc
soundwire
spi spi: sc18is602: implement .max_{transfer,message}_size() for the controller 2021-05-21 13:13:33 +01:00
spmi
ssb
staging staging: rtl8723bs: avoid bogus gcc warning 2021-05-10 14:26:24 +02:00
target SCSI misc on 20210508 2021-05-08 10:44:36 -07:00
tc
tee AMD-TEE reference count loaded TAs 2021-05-17 16:06:02 +02:00
thermal - Remove duplicate error message for the amlogic driver (Tang Bin) 2021-05-05 12:46:48 -07:00
thunderbolt
tty Char/misc driver fixes for 5.13-rc3 2021-05-20 06:31:52 -10:00
uio uio_hv_generic: Fix another memory leak in error handling paths 2021-05-14 13:26:04 +02:00
usb Driver core fixes for 5.13-rc2 2021-05-16 10:13:14 -07:00
vdpa {net,vdpa}/mlx5: Configure interface MAC into mpfs L2 table 2021-05-18 23:01:48 -07:00
vfio
vhost virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00
video Char/misc driver fixes for 5.13-rc3 2021-05-20 06:31:52 -10:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen-pciback: reconfigure also from backend watch handler 2021-05-21 09:55:16 +02:00
zorro
Kconfig
Makefile virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00