linux-stable/drivers
Alexander Lobakin 5e7f59fa07 virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1`
There are five virtchnl structures, which are allocated and checked in
the code as `nents + 1`, meaning that they always have memory for one
excessive element regardless of their actual number. This comes from
that their sizeof() includes space for 1 element and then they get
allocated via struct_size() or its open-coded equivalents, passing
the actual number of elements.
Expand virtchnl_struct_size() to handle such structures and replace
those 1-elem arrays with proper flex ones. Also fix several places
which open-code %IAVF_VIRTCHNL_VF_RESOURCE_SIZE. Finally, let the
virtchnl_ether_addr_list size be computed automatically when there's
no enough space for the whole list, otherwise we have to open-code
reverse struct_size() logics.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-08-16 09:05:04 -07:00
..
accel Memory leak fixes in drm/client, memory access/leak fixes for 2023-07-21 12:14:05 +10:00
accessibility
acpi ACPI/IORT: Remove erroneous id_count check in iort_node_get_rmr_info() 2023-07-28 14:50:50 +01:00
amba
android
ata ata,scsi: do not issue START STOP UNIT on resume 2023-08-02 17:01:12 +09:00
atm
auxdisplay drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
base driver core: cpu: Make cpu_show_not_affected() static 2023-08-10 13:25:12 +02:00
bcma
block genetlink: remove userhdr from struct genl_info 2023-08-15 14:54:44 -07:00
bluetooth Bluetooth: btrtl: Load FW v2 otherwise FW v1 for RTL8852C 2023-08-11 11:57:13 -07:00
bus SoC fixes for 6.5, part 1 2023-07-06 09:56:53 -07:00
cdrom cdrom/gdrom: Fix build error 2023-06-29 08:09:31 -06:00
cdx
char tpm: Add a helper for checking hwrng enabled 2023-08-09 10:05:15 -07:00
clk Amlogic clock fixes for v6.5 2023-07-26 11:47:57 -07:00
clocksource RISC-V Patches for the 6.5 Merge Window, Part 1 2023-06-30 09:37:26 -07:00
comedi comedi: make all 'class' structures const 2023-06-23 10:29:02 +02:00
connector connector/cn_proc: Allow non-root users access 2023-07-23 11:34:22 +01:00
counter
cpufreq cpufreq: sparc: Don't mark cpufreq callbacks with __init 2023-07-12 12:45:18 +02:00
cpuidle
crypto s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
cxl cxl/memdev: Only show sanitize sysfs files when supported 2023-07-28 13:16:54 -06:00
dax dax: enable dax fault handler to report VM_FAULT_HWPOISON 2023-06-26 07:54:23 -06:00
dca
devfreq
dio
dma dmaengine: xilinx: xdma: Fix typo 2023-08-07 00:01:41 +05:30
dma-buf dma-buf/dma-resv: Stop leaking on krealloc() failure 2023-07-15 13:57:30 +02:00
edac - Add initial support for RAS hardware found on AMD server GPUs (MI200). 2023-06-26 15:09:18 -07:00
eisa
extcon
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-06-24 14:03:46 +09:00
firmware firmware: arm_scmi: Fix chan_free cleanup on SMC 2023-07-20 13:31:58 +01:00
fpga Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
fsi
gnss
gpio gpio: mvebu: fix irq domain leak 2023-07-20 14:38:36 +02:00
gpu Merge tag 'drm-intel-fixes-2023-08-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2023-08-04 09:38:38 +10:00
greybus
hid for-netdev 2023-07-13 19:13:24 -07:00
hsi
hte
hv x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg 2023-06-28 17:53:25 +00:00
hwmon hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature 2023-07-27 09:41:07 -07:00
hwspinlock
hwtracing Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
i2c Part 2 of I2C patches for 6.5 2023-07-08 12:28:00 -07:00
i3c
idle Revert "intel_idle: Add support for using intel_idle in a VM guest using just hlt" 2023-07-19 20:10:03 +02:00
iio driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
infiniband net/mlx5: Allocate completion EQs dynamically 2023-08-07 10:53:52 -07:00
input ARM: SoC changes for 6.5 2023-06-29 15:28:33 -07:00
interconnect
iommu iommufd: Set end correctly when doing batch carry 2023-07-27 11:27:20 -03:00
ipack
irqchip - Work around an erratum on GIC700, where a race between a CPU 2023-07-30 10:59:19 -07:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-03 18:08:32 -07:00
leds leds: trig-netdev: Disable offload on deactivation of trigger 2023-08-10 17:35:00 -07:00
macintosh
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-06-30 17:35:45 -05:00
mcb
md dm cache policy smq: ensure IO doesn't prevent cleaner policy progress 2023-07-25 11:55:50 -04:00
media hardening fixes for v6.5-rc6 2023-08-08 14:59:49 -07:00
memory memory: tegra: make icc_set_bw return zero if BWMGR not supported 2023-07-25 22:09:20 +02:00
memstick
message
mfd - New Drivers 2023-07-03 10:55:04 -07:00
misc misc/genalloc: Name subpools by of_node_full_name() 2023-07-26 09:45:01 +02:00
mmc mmc: sdhci-f-sdh30: Replace with sdhci_pltfm 2023-07-14 11:28:55 +02:00
most
mtd mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 2023-07-27 16:54:23 +02:00
mux
net virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1` 2023-08-16 09:05:04 -07:00
nfc nfc: virtual_ncidev: Use module_misc_device macro to simplify the code 2023-08-16 09:54:16 +01:00
ntb ntb: hw: amd: Fix debugfs_create_dir error checking 2023-07-08 13:55:44 -04:00
nubus
nvdimm dax: enable dax fault handler to report VM_FAULT_HWPOISON 2023-06-26 07:54:23 -06:00
nvme SCSI fixes on 20230714 2023-07-14 19:57:29 -07:00
nvmem
of of: Preserve "of-display" device name for compatibility 2023-07-11 16:33:01 -06:00
opp OPP: Properly propagate error along when failing to get icc_path 2023-06-27 07:35:14 +05:30
parisc parisc: Move init function declarations into header file 2023-06-30 17:14:15 +02:00
parport parport: gsc: remove DMA leftover code 2023-08-03 14:40:37 +02:00
pci PCI: move OF status = "disabled" detection to dev->match_driver 2023-08-09 09:18:30 +01:00
pcmcia
peci
perf perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() 2023-07-12 07:41:23 -07:00
phy phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-07-24 16:23:37 +05:30
pinctrl pinctrl: renesas: Fixes for v6.5 2023-07-13 00:05:52 +02:00
platform platform/x86: huawei-wmi: Silence ambient light sensor 2023-07-25 16:38:03 +02:00
pnp
power power supply and reset changes for the 6.5 series 2023-07-03 17:23:16 -07:00
powercap powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
pps
ps3
ptp net: ptp: create a mock-up PTP Hardware Clock driver 2023-08-09 15:59:21 -07:00
pwm pwm: Changes for v6.5-rc1 2023-07-05 12:55:06 -07:00
rapidio
ras
regulator regulator: mt6358: Fix incorrect VCN33 sync error message 2023-07-23 23:40:09 +01:00
remoteproc remoteproc updates for v6.5 2023-07-03 17:03:05 -07:00
reset ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
rpmsg
rtc RTC for 6.5 2023-07-03 10:43:10 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
sbus oradax: make 'cl' a static const structure 2023-06-23 10:27:02 +02:00
scsi ata fixes for 6.5-rc5 2023-08-05 18:45:18 -07:00
sh
siox
slimbus
soc soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child 2023-07-19 15:44:02 +08:00
soundwire soundwire: amd: Fix a check for errors in probe() 2023-07-13 11:09:07 +05:30
spi spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized reads 2023-07-26 12:47:20 +01:00
spmi
ssb
staging Staging driver fixes for 6.5-rc4 2023-07-30 11:47:56 -07:00
target SCSI misc on 20230708 2023-07-08 12:35:18 -07:00
tc
tee ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
thermal powercap: intel_rapl: Fix a sparse warning in TPMI interface 2023-08-01 13:45:08 +02:00
thunderbolt
tty TTY/Serial fixes for 6.5-rc4 2023-07-30 11:51:36 -07:00
ufs Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes 2023-07-11 12:15:15 -04:00
uio
usb usb: misc: ehset: fix wrong if condition 2023-07-27 10:37:30 +02:00
vdpa net/mlx5: Allocate completion EQs dynamically 2023-08-07 10:53:52 -07:00
vfio net/mlx5: Allocate completion EQs dynamically 2023-08-07 10:53:52 -07:00
vhost virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
video fbdev: Explicitly include correct DT includes 2023-07-20 07:56:30 +02:00
virt workqueue: Ordered workqueue creation cleanups 2023-06-27 16:46:06 -07:00
virtio virtio: allow caller to override device DMA mask in vp_modern 2023-06-27 10:47:08 -04:00
vlynq
w1 connector/cn_proc: Add filtering to fix some bugs 2023-07-23 11:34:22 +01:00
watchdog watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub) 2023-06-26 14:30:07 +02:00
xen xen: speed up grant-table reclaim 2023-07-27 07:53:12 +02:00
zorro
Kconfig
Makefile