linux-stable/drivers
Zhong Jinghua 4be26d553a loop: loop_set_status_from_info() check before assignment
[ Upstream commit 9f6ad5d533 ]

In loop_set_status_from_info(), lo->lo_offset and lo->lo_sizelimit should
be checked before reassignment, because if an overflow error occurs, the
original correct value will be changed to the wrong value, and it will not
be changed back.

More, the original patch did not solve the problem, the value was set and
ioctl returned an error, but the subsequent io used the value in the loop
driver, which still caused an alarm:

loop_handle_cmd
 do_req_filebacked
  loff_t pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;
  lo_rw_aio
   cmd->iocb.ki_pos = pos

Fixes: c490a0b5a4 ("loop: Check for overflow while configuring loop")
Signed-off-by: Zhong Jinghua <zhongjinghua@huawei.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230221095027.3656193-1-zhongjinghua@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 13:55:30 +01:00
..
accessibility
acpi ACPI: video: Fix Lenovo Ideapad Z570 DMI match 2023-03-10 09:33:52 +01:00
amba
android
ata ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller" 2023-03-10 09:32:32 +01:00
atm
auxdisplay auxdisplay: hd44780: Fix potential memory leak in hd44780_remove() 2023-03-11 13:55:16 +01:00
base driver core: fw_devlink: Avoid spurious error message 2023-03-10 09:34:01 +01:00
bcma
block loop: loop_set_status_from_info() check before assignment 2023-03-11 13:55:30 +01:00
bluetooth Bluetooth: btusb: Add VID:PID 13d3:3529 for Realtek RTL8821CE 2023-03-10 09:33:53 +01:00
bus bus: mhi: ep: Save channel state locally during suspend and resume 2023-03-10 09:34:31 +01:00
cdrom
char ipmi_ssif: Rename idle state and check 2023-03-10 09:34:03 +01:00
clk clk: mxl: syscon_node_to_regmap() returns error pointers 2023-02-25 11:25:39 +01:00
clocksource clocksource/drivers/riscv: Patch riscv_clock_next_event() jump before first use 2023-03-10 09:33:03 +01:00
comedi
connector
counter
cpufreq cpufreq: davinci: Fix clk use after free 2023-03-10 09:33:01 +01:00
cpuidle cpuidle: add ARCH_SUSPEND_POSSIBLE dependencies 2023-03-10 09:34:22 +01:00
crypto crypto: qat - fix out-of-bounds read 2023-03-10 09:34:19 +01:00
cxl cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
dax dax/kmem: Fix leak of memory-hotplug resources 2023-03-10 09:34:25 +01:00
dca
devfreq
dio
dma dmaengine: ptdma: check for null desc before calling pt_cmd_callback 2023-03-10 09:33:39 +01:00
dma-buf dma-buf: actually set signaling bit for private stub fences 2023-02-09 11:28:23 +01:00
edac
eisa
extcon
firewire
firmware firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-10 09:34:02 +01:00
fpga fpga: microchip-spi: rewrite status polling in a time measurable way 2023-03-10 09:33:34 +01:00
fsi
gnss
gpio gpio: vf610: connect GPIO label to dev name 2023-03-10 09:33:18 +01:00
gpu drm/i915: move a Kconfig symbol to unbreak the menu presentation 2023-03-11 13:55:25 +01:00
greybus
hid HID: logitech-hidpp: Don't restart communication if not necessary 2023-03-10 09:34:00 +01:00
hsi
hte
hv HV: hv_balloon: fix memory leak with using debugfs_lookup() 2023-02-09 11:28:21 +01:00
hwmon hwmon: (nct6775) Fix incorrect parenthesization in nct6775_write_fan_div() 2023-03-10 09:34:23 +01:00
hwspinlock
hwtracing hwtracing: hisi_ptt: Only add the supported devices to the filters list 2023-03-10 09:33:31 +01:00
i2c i2c: designware: fix i2c_dw_clk_rate() return size to be u32 2023-03-10 09:33:29 +01:00
i3c
idle cpuidle, intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again* 2023-03-10 09:32:36 +01:00
iio iio: light: tsl2563: Do not hardcode interrupt trigger type 2023-03-10 09:33:29 +01:00
infiniband RDMA/siw: Fix user page pinning accounting 2023-03-10 09:34:11 +01:00
input
interconnect
iommu iommu/vt-d: Fix PASID directory pointer coherency 2023-03-10 09:34:32 +01:00
ipack
irqchip irqchip/irq-bcm7120-l2: Set IRQ_LEVEL for level triggered interrupts 2023-03-10 09:33:07 +01:00
isdn
leds leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver 2023-03-10 09:33:26 +01:00
macintosh
mailbox
mcb
md dm flakey: fix a bug with 32-bit highmem systems 2023-03-10 09:34:23 +01:00
media media: ipu3-cio2: Fix PM runtime usage_count in driver unbind 2023-03-10 09:34:26 +01:00
memory memory: renesas-rpc-if: Move resource acquisition to .probe() 2023-03-11 13:55:17 +01:00
memstick
message
mfd mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read() 2023-03-10 09:33:28 +01:00
misc habanalabs: fix bug in timestamps registration code 2023-03-10 09:33:58 +01:00
mmc mmc: mmc_spi: fix error handling in mmc_spi_probe() 2023-02-22 12:59:48 +01:00
most
mtd ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed 2023-03-11 13:55:21 +01:00
mux
net net: dsa: felix: fix internal MDIO controller resource length 2023-03-11 13:55:28 +01:00
nfc nfc: fix memory leak of se_io context in nfc_genl_se_io 2023-03-11 13:55:27 +01:00
ntb
nubus
nvdimm cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
nvme nvme-pci: refresh visible attrs for cmb attributes 2023-02-22 12:59:56 +01:00
nvmem nvmem: core: fix return value 2023-02-09 11:28:25 +01:00
of of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem 2023-02-22 12:59:46 +01:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-03-10 09:33:01 +01:00
parisc
parport
pci PCI/DPC: Await readiness of secondary bus after reset 2023-03-10 09:34:31 +01:00
pcmcia
peci
perf
phy phy: rockchip-typec: fix tcphy_get_mode error case 2023-03-10 09:33:38 +01:00
pinctrl pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:33:59 +01:00
platform platform/chrome: cros_ec_typec: Update port DP VDO 2023-03-10 09:32:52 +01:00
pnp
power power: supply: remove faulty cooling logic 2023-03-10 09:33:36 +01:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:32:56 +01:00
pps
ps3
ptp ptp: vclock: use mutex to fix "sleep on atomic" bug 2023-03-11 13:55:25 +01:00
pwm pwm: stm32-lp: fix the check on arr and cmp registers update 2023-03-11 13:55:17 +01:00
rapidio
ras
regulator regulator: core: Use ktime_get_boottime() to determine how long a regulator was off 2023-03-10 09:34:25 +01:00
remoteproc remoteproc/mtk_scp: Move clk ops outside send_lock 2023-03-10 09:34:26 +01:00
reset
rpmsg rpmsg: glink: Release driver_override 2023-03-10 09:33:45 +01:00
rtc rtc: allow rtc_read_alarm without read_alarm callback 2023-03-11 13:55:30 +01:00
s390 s390: vfio-ap: tighten the NIB validity check 2023-03-10 09:33:02 +01:00
sbus
scsi scsi: mpi3mr: Use number of bits to manage bitmap sizes 2023-03-11 13:55:29 +01:00
sh
siox
slimbus
soc soc: qcom: stats: Populate all subsystem debugfs files 2023-03-11 13:55:22 +01:00
soundwire soundwire: cadence: Don't overflow the command FIFOs 2023-03-10 09:33:29 +01:00
spi spi: tegra210-quad: Fix iterator outside loop 2023-03-11 13:55:29 +01:00
spmi
ssb
staging media: atomisp: Only set default_run_mode on first open of a stream/asd 2023-03-10 09:33:44 +01:00
target scsi: target: core: Fix warning on RT kernels 2023-02-09 11:28:12 +01:00
tc
tee
thermal thermal: intel: powerclamp: Fix cur_state for multi package system 2023-03-10 09:34:22 +01:00
thunderbolt
tty vc_screen: modify vcs_size() handling in vcs_read() 2023-03-11 13:55:29 +01:00
ufs scsi: ufs: core: Fix device management cmd timeout flow 2023-03-10 09:34:00 +01:00
uio
usb usb: host: fsl-mph-dr-of: reuse device_set_of_node_from_dev 2023-03-10 09:33:38 +01:00
vdpa vdpa: ifcvf: Do proper cleanup if IFCVF init fails 2023-02-22 12:59:42 +01:00
vfio vfio/type1: restore locked_vm 2023-03-10 09:34:32 +01:00
vhost
video Revert "fbcon: don't lose the console font across generic->chip driver switch" 2023-03-10 09:33:56 +01:00
virt virt/sev-guest: Return -EIO if certificate buffer is not large enough 2023-03-10 09:34:14 +01:00
virtio
vlynq
w1
watchdog watchdog: sbsa_wdog: Make sure the timeout programming is within the limits 2023-03-11 13:55:24 +01:00
xen xen/grant-dma-iommu: Implement a dummy probe_device() callback 2023-03-10 09:33:02 +01:00
zorro
Kconfig
Makefile