linux-stable/drivers
Mikulas Patocka cb2b974ad5 dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata()
commit b86f4b790c upstream.

__bio_for_each_segment assumes that the first struct bio_vec argument
doesn't change - it calls "bio_advance_iter_single((bio), &(iter),
(bvl).bv_len)" to advance the iterator. Unfortunately, the dm-integrity
code changes the bio_vec with "bv.bv_len -= pos". When this code path
is taken, the iterator would be out of sync and dm-integrity would
report errors. This happens if the machine is out of memory and
"kmalloc" fails.

Fix this bug by making a copy of "bv" and changing the copy instead.

Fixes: 7eada909bf ("dm: add integrity target")
Cc: stable@vger.kernel.org	# v4.12+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-08 11:25:04 +01:00
..
accessibility
acpi ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 10:27:33 +01:00
amba amba: bus: fix refcount leak 2023-09-23 10:46:59 +02:00
android binder: fix memory leak in binder_init() 2023-08-30 16:35:13 +02:00
ata ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-12-08 08:41:58 +01:00
atm atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 15:32:32 +01:00
auxdisplay
base driver core: Release all resources during unbind before updating device links 2023-12-08 08:42:00 +01:00
bcma
block remove the sx8 block driver 2023-11-08 11:21:09 +01:00
bluetooth Bluetooth: vhci: Fix race when opening vhci device 2023-10-25 11:13:31 +02:00
bus bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() 2023-02-22 12:46:01 +01:00
cdrom
char hwrng: geode - fix accessing registers 2023-11-20 10:27:34 +01:00
clk clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data 2023-11-20 10:27:33 +01:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 16:45:42 +00:00
connector
cpufreq cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit() 2023-09-23 10:46:54 +02:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2023-01-18 09:26:09 +01:00
crypto crypto: stm32 - fix loop iterating through scatterlist for DMA 2023-09-23 10:47:01 +02:00
dax
dca
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-23 10:46:59 +02:00
dio drivers: dio: fix possible memory leak in dio_init() 2023-01-18 09:26:22 +01:00
dma dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() 2023-11-20 10:27:35 +01:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:35:16 +02:00
edac EDAC/device: Respect any driver-supplied workqueue polling value 2023-02-06 07:46:31 +01:00
eisa
extcon extcon: Fix kernel doc of property capability fields to avoid warnings 2023-08-11 11:33:39 +02:00
firewire firewire: core: fix possible memory leak in create_units() 2023-12-08 08:42:00 +01:00
firmware firmware: ti_sci: Mark driver as non removable 2023-11-20 10:27:34 +01:00
fmc
fpga
fsi
gpio gpio: vf610: set value before the direction to avoid a glitch 2023-10-25 11:13:33 +02:00
gpu drm/amdgpu: correct chunk_ptr to a pointer to chunk. 2023-12-13 16:46:15 +01:00
hid HID: hid-asus: add const to read-only outgoing usb buffer 2023-12-20 15:32:37 +01:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2023-01-18 09:26:26 +01:00
hv Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-06-28 10:14:19 +02:00
hwmon hwmon: (acpi_power_meter) Fix 4.29 MW bug 2023-12-13 16:46:16 +01:00
hwspinlock
hwtracing coresight-etm4: Fix for() loop drvdata->nr_addr_cmp range bug 2023-04-20 12:02:12 +02:00
i2c i2c: i801: fix potential race in i801_block_transaction_byte_by_byte 2023-11-28 16:45:45 +00:00
ide treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
idle
iio iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2024-01-08 11:25:03 +01:00
infiniband RDMA/bnxt_re: Correct module description string 2023-12-13 16:46:15 +01:00
input Input: ipaq-micro-keys - add error handling for devm_kmemdup 2024-01-08 11:25:03 +01:00
iommu iommu/amd: Fix ivrs_acpihid cmdline parsing code 2023-01-18 09:26:38 +01:00
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 11:21:08 +01:00
isdn mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2023-01-18 09:26:28 +01:00
leds
lightnvm
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-17 11:11:44 +02:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-08-11 11:33:40 +02:00
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 16:45:45 +00:00
md dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata() 2024-01-08 11:25:04 +01:00
media media: venus: hfi: fix the check to handle session buffer requirement 2023-11-28 16:45:45 +00:00
memory
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-08-11 11:33:34 +02:00
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-30 12:38:35 +01:00
mfd mfd: dln2: Fix double put in dln2_probe 2023-11-20 10:27:34 +01:00
misc misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() 2023-11-20 10:27:34 +01:00
mmc mmc: meson-gx: Remove setting of CMD_CFG_ERROR 2023-11-28 16:45:45 +00:00
mtd mtd: rawnand: brcmnand: Fix ecc chunk calculation for erased page bitfips 2023-12-08 08:41:59 +01:00
mux
net ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-01-08 11:25:03 +01:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:14:20 +02:00
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-23 10:47:00 +02:00
nubus
nvdimm
nvme nvmet: avoid potential UAF in nvmet_req_complete() 2023-03-22 13:26:14 +01:00
nvmem
of of: unittest: fix null pointer dereferencing in of_unittest_find_node_by_name() 2023-09-23 10:46:56 +02:00
oprofile
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-10 21:43:39 +02:00
parport parport: Add support for Brainboxes IX/UC/PX parallel cards 2023-12-13 16:46:17 +01:00
pci PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 16:45:44 +00:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:27:35 +01:00
perf
phy phy: st: miphy28lp: use _poll_timeout functions for waits 2023-05-30 12:38:36 +01:00
pinctrl pinctrl: avoid reload of p state in list iteration 2023-12-08 08:41:59 +01:00
platform platform/x86: intel_telemetry: Fix kernel doc descriptions 2023-12-20 15:32:36 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2023-01-18 09:26:10 +01:00
power power: supply: Fix logic checking if system is running from battery 2023-06-21 15:38:57 +02:00
powercap
pps
ps3
ptp
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 10:27:35 +01:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2023-01-18 09:26:12 +01:00
ras
regulator regulator: Fix error checking for debugfs_create_dir 2023-06-21 15:38:57 +02:00
remoteproc
reset
rpmsg rpmsg: Fix possible refcount leak in rpmsg_register_device_override() 2023-11-08 11:21:08 +01:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-23 10:46:52 +02:00
s390 s390/dasd: protect device queue against concurrent access 2023-12-08 08:41:59 +01:00
sbus
scsi scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() 2023-12-13 16:46:16 +01:00
sfi
sh
sn
soc soc/fsl/qe: fix usb.c build errors 2023-08-11 11:33:37 +02:00
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-23 10:46:54 +02:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-17 11:11:44 +02:00
ssb treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
staging staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext() 2023-08-11 11:33:53 +02:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 21:43:41 +02:00
tc
tee
thermal thermal: core: prevent potential string overflow 2023-11-20 10:27:33 +01:00
thunderbolt thunderbolt: Use const qualifier for ring_interrupt_index 2023-04-05 11:14:16 +02:00
tty serial: 8250_omap: Add earlycon support for the AM654 UART controller 2023-12-13 16:46:17 +01:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2023-01-18 09:26:23 +01:00
usb USB: serial: option: add Quectel RM500Q R13 firmware support 2024-01-08 11:25:04 +01:00
uwb
vfio vfio: platform: Do not pass return buffer to ACPI _RST method 2023-01-18 09:26:23 +01:00
vhost treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
video fbdev: fsl-diu-fb: mark wr_reg_wa() static 2023-11-20 10:27:35 +01:00
virt
virtio virtio_balloon: Fix endless deflation and inflation on arm64 2023-11-08 11:21:05 +01:00
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-18 09:26:25 +01:00
w1 w1: fix loop in w1_fini() 2023-08-11 11:33:38 +02:00
watchdog watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running 2023-10-10 21:43:39 +02:00
xen xen/events: replace evtchn_rwlock with RCU 2023-10-10 21:43:42 +02:00
zorro
Kconfig
Makefile