linux-stable/drivers
Zhang Shurong 4f96c0665f md: raid1: fix potential OOB in raid1_remove_disk()
[ Upstream commit 8b0472b50b ]

If rddev->raid_disk is greater than mddev->raid_disks, there will be
an out-of-bounds in raid1_remove_disk(). We have already found
similar reports as follows:

1) commit d17f744e88 ("md-raid10: fix KASAN warning")
2) commit 1ebc2cec0b ("dm raid: fix KASAN warning in raid5_remove_disk")

Fix this bug by checking whether the "number" variable is
valid.

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/tencent_0D24426FAC6A21B69AC0C03CE4143A508F09@qq.com
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:09:57 +02:00
..
accessibility
acpi ACPI: x86: s2idle: Catch multiple ACPI_TYPE_PACKAGE objects 2023-09-23 11:09:55 +02:00
amba amba: bus: fix refcount leak 2023-09-19 12:22:47 +02:00
android binder: fix memory leak in binder_init() 2023-08-16 18:21:59 +02:00
ata ata: pata_ftide010: Add missing MODULE_DESCRIPTION 2023-09-19 12:23:01 +02:00
atm
auxdisplay
base driver core: test_async: fix an error code 2023-09-19 12:22:45 +02:00
bcma
block pcd: fix error codes in pcd_init_unit() 2023-09-19 12:23:04 +02:00
bluetooth Bluetooth: btusb: Do not call kfree_skb() under spin_lock_irqsave() 2023-09-19 12:22:34 +02:00
bus bus: ti-sysc: Configure uart quirks for k3 SoC 2023-09-23 11:09:57 +02:00
cdrom
char tpm_tis: Resend command to recover from data transfer errors 2023-09-23 11:09:56 +02:00
clk clk: qcom: mss-sc7180: fix missing resume during probe 2023-09-19 12:22:56 +02:00
clocksource
comedi
connector
counter
cpufreq cpufreq: brcmstb-avs-cpufreq: Fix -Warray-bounds bug 2023-09-19 12:22:52 +02:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-19 12:22:42 +02:00
crypto crypto: stm32 - fix loop iterating through scatterlist for DMA 2023-09-19 12:22:52 +02:00
cxl
dax
dca
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-19 12:22:50 +02:00
dio
dma dmaengine: sh: rz-dmac: Fix destination and source data size setting 2023-09-19 12:23:01 +02:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:18:21 +02:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-19 12:22:40 +02:00
eisa
extcon extcon: usbc-tusb320: Convert to i2c's .probe_new() 2023-07-23 13:47:31 +02:00
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-08-26 14:23:24 +02:00
firmware arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:22:52 +02:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-19 12:22:46 +02:00
gnss
gpio gpio: mvebu: fix irq domain leak 2023-08-03 10:22:26 +02:00
gpu drm/exynos: fix a possible null-pointer dereference due to data race in exynos_drm_crtc_atomic_disable() 2023-09-23 11:09:57 +02:00
greybus
hid HID: multitouch: Correct devm device reference for hidinput input_dev name 2023-09-19 12:22:48 +02:00
hsi
hv
hwmon hwmon: (tmp513) Fix the channel number in tmp51x_is_visible() 2023-09-19 12:22:35 +02:00
hwspinlock
hwtracing coresight: tmc: Explicit type conversions to prevent integer overflow 2023-09-19 12:22:45 +02:00
i2c i2c: designware: Handle invalid SMBus block data response length value 2023-08-26 14:23:32 +02:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-19 12:22:51 +02:00
idle
iio iio: addac: stx104: Fix race condition when converting analog-to-digital 2023-08-26 14:23:27 +02:00
infiniband Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-19 12:22:48 +02:00
input Input: tca6416-keypad - fix interrupt enable disbalance 2023-09-19 12:22:57 +02:00
interconnect
iommu iommu/vt-d: Fix to flush cache of PASID directory table 2023-09-19 12:22:46 +02:00
ipack
irqchip irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation 2023-08-03 10:22:45 +02:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:22:01 +02:00
leds leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead 2023-09-19 12:22:49 +02:00
macintosh
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-07-23 13:47:28 +02:00
mcb
md md: raid1: fix potential OOB in raid1_remove_disk() 2023-09-23 11:09:57 +02:00
media media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts 2023-09-19 12:22:51 +02:00
memory
memstick
message
mfd mfd: pm8008: Fix module autoloading 2023-07-23 13:47:51 +02:00
misc misc: rtsx: judge ASPM Mode to set PETXCFG Reg 2023-08-16 18:21:59 +02:00
mmc mmc: sdhci-esdhc-imx: improve ESDHC_FLAG_ERR010450 2023-09-23 11:09:56 +02:00
most
mtd mtd: rawnand: brcmnand: Fix potential false time out warning 2023-09-19 12:23:02 +02:00
mux
net wifi: mac80211_hwsim: drop short frames 2023-09-23 11:09:56 +02:00
nfc
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-19 12:22:51 +02:00
nubus
nvdimm
nvme nvme-rdma: fix potential unbalanced freeze & unfreeze 2023-08-16 18:22:03 +02:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-07-23 13:47:25 +02:00
of of: unittest: Fix overlay type in apply/revert check 2023-09-19 12:22:40 +02:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-19 12:22:31 +02:00
parisc parisc: led: Reduce CPU overhead for disk & lan LED computation 2023-09-19 12:22:55 +02:00
parport
pci Revert "PCI: Mark NVIDIA T4 GPUs to avoid bus reset" 2023-09-19 12:22:51 +02:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-26 14:23:24 +02:00
perf perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:09:55 +02:00
phy phy/rockchip: inno-hdmi: do not power on rk3328 post pll on reg write 2023-09-19 12:22:48 +02:00
pinctrl pinctrl: cherryview: fix address_space_handler() argument 2023-09-19 12:22:55 +02:00
platform platform/mellanox: mlxbf-pmc: Fix reading of unprogrammed events 2023-09-19 12:23:04 +02:00
pnp
power
powercap
pps
ps3
ptp
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:22:58 +02:00
rapidio
ras
regulator
remoteproc
reset
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-19 12:22:48 +02:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:28:37 +01:00
s390 s390/zcrypt: don't leak memory if dev_set_name() fails 2023-09-19 12:22:59 +02:00
sbus
scsi block: move GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE to disk->event_flags 2023-09-19 12:23:02 +02:00
sh
siox
slimbus
soc soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-19 12:22:56 +02:00
soundwire soundwire: fix enumeration completion 2023-08-11 15:14:00 +02:00
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-19 12:22:32 +02:00
spmi
ssb
staging media: dvb: symbol fixup for dvb_attach() 2023-09-19 12:22:51 +02:00
target
tc
tee
thermal
thunderbolt thunderbolt: Read retimer NVM authentication status prior tb_retimer_set_inbound_sbtx() 2023-08-26 14:23:24 +02:00
tty serial: tegra: handle clk prepare error in tegra_uart_hw_init() 2023-09-19 12:22:47 +02:00
uio
usb USB: core: Fix oversight in SuperSpeed initialization 2023-09-19 12:22:53 +02:00
vdpa vduse: Use proper spinlock for IRQ injection 2023-08-26 14:23:30 +02:00
vfio vfio/type1: fix cap_migration information leak 2023-09-19 12:22:41 +02:00
vhost
video backlight: gpio_backlight: Drop output GPIO direction check for initial power state 2023-09-19 12:22:57 +02:00
virt
virtio virtio_ring: fix avail_wrap_counter in virtqueue_add_packed 2023-09-19 12:22:49 +02:00
visorbus
vlynq
vme
w1
watchdog watchdog: intel-mid_wdt: add MODULE_ALIAS() to allow auto-load 2023-09-19 12:22:57 +02:00
xen
zorro
Kconfig
Makefile