linux-stable/drivers
Daniel Mentz 362b2f65d6 scsi: ufs: core: Leave space for '\0' in utf8 desc string
[ Upstream commit a75a16c62a ]

utf16s_to_utf8s does not NULL terminate the output string. For us to be
able to add a NULL character when utf16s_to_utf8s returns, we need to make
sure that there is space for such NULL character at the end of the output
buffer. We can achieve this by passing an output buffer size to
utf16s_to_utf8s that is one character less than what we allocated.

Other call sites of utf16s_to_utf8s appear to be using the same technique
where they artificially reduce the buffer size by one to leave space for a
NULL character or line feed character.

Fixes: 4b828fe156 ("scsi: ufs: revamp string descriptor reading")
Reviewed-by: Mars Cheng <marscheng@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Yen-lin Lai <yenlinlai@google.com>
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Link: https://lore.kernel.org/r/20231017182026.2141163-1-danielmentz@google.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:22 +01:00
..
accel accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() 2023-11-20 11:59:11 +01:00
accessibility
acpi ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 11:59:03 +01:00
amba amba: bus: fix refcount leak 2023-08-22 15:50:57 +02:00
android binder: fix memory leaks of spam and pending work 2023-10-05 12:48:08 +02:00
ata scsi: sd: Introduce manage_shutdown device flag 2023-10-27 10:00:19 +09:00
atm
auxdisplay drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
base regmap: debugfs: Fix a erroneous check after snprintf() 2023-11-20 11:59:04 +01:00
bcma
block block-6.6-2023-10-06 2023-10-06 15:43:19 -07:00
bluetooth Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED 2023-11-08 11:56:22 +01:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-09-13 10:24:53 +03:00
cache riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT 2023-10-26 09:42:37 +02:00
cdrom
cdx
char hwrng: geode - fix accessing registers 2023-11-20 11:59:18 +01:00
clk clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped 2023-11-20 11:59:16 +01:00
clocksource clocksource/drivers/arm_arch_timer: limit XGene-1 workaround 2023-11-20 11:59:12 +01:00
comedi Revert "comedi: add HAS_IOPORT dependencies" 2023-09-12 15:49:20 +02:00
connector Fix NULL pointer dereference in cn_filter() 2023-10-24 10:53:45 +02:00
counter First set of Counter fixes for 6.6 2023-10-02 13:13:15 +02:00
cpufreq cpufreq: tegra194: fix warning due to missing opp_put 2023-11-20 11:58:57 +01:00
cpuidle powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
crypto crypto: hisilicon/qm - fix PF queue parameter issue 2023-11-20 11:59:20 +01:00
cxl cxl/acpi: Annotate struct cxl_cxims_data with __counted_by 2023-09-22 14:31:04 -07:00
dax mm: remove enum page_entry_size 2023-08-24 16:20:30 -07:00
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:59:00 +01:00
dio
dma dmaengine fixes for v6.6 2023-10-13 08:52:57 -07:00
dma-buf dma-buf: add dma_fence_timestamp helper 2023-10-05 11:05:58 +02:00
edac Intel EDAC fixes: 2023-08-30 19:23:00 -07:00
eisa
extcon
firewire scsi: sd: Introduce manage_shutdown device flag 2023-10-27 10:00:19 +09:00
firmware firmware: tegra: Add suspend hook and reset BPMP IPC early on resume 2023-11-20 11:59:16 +01:00
fpga fpga: Fix memory leak for fpga_region_test_class_find() 2023-10-24 19:32:39 +02:00
fsi fsi: i2cr: Switch to use struct i2c_driver's .probe() 2023-08-22 15:51:33 +02:00
gnss
gpio gpio: sim: initialize a managed pointer when declaring it 2023-11-20 11:59:04 +01:00
gpu drm/amd/pm: Fix a memory leak on an error path 2023-11-20 11:59:13 +01:00
greybus
hid hid: cp2112: Fix duplicate workqueue initialization 2023-11-20 11:59:20 +01:00
hsi
hte hte: tegra: Fix missing error code in tegra_hte_test_probe() 2023-11-20 11:59:08 +01:00
hv hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
hwmon hwmon: (sch5627) Disallow write access if virtual registers are locked 2023-11-20 11:59:08 +01:00
hwspinlock
hwtracing coresight: tmc-etr: Disable warnings for allocation failures 2023-09-20 10:46:30 +01:00
i2c i2c: stm32f7: Fix PEC handling in case of SMBUS transfers 2023-10-21 20:31:04 +02:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-06 01:21:47 +02:00
idle Perf events changes for v6.6: 2023-08-28 16:35:01 -07:00
iio iio: afe: rescale: Accept only offset channels 2023-10-17 20:25:32 +01:00
infiniband RDMA/hns: Fix init failure of RoCE VF and HIP08 2023-11-20 11:59:21 +01:00
input Input updates for v6.6-rc5 2023-10-13 23:19:16 -07:00
interconnect This pull request is full of clk driver changes. In fact, there aren't any 2023-08-30 19:53:39 -07:00
iommu iommufd: Add iopt_area_alloc() 2023-11-20 11:59:17 +01:00
ipack
irqchip irqchip/sifive-plic: Fix syscore registration for multi-socket systems 2023-11-20 11:58:54 +01:00
isdn isdn: mISDN: hfcsusb: Spelling fix in comment 2023-10-23 09:39:46 +01:00
leds leds: Drop BUG_ON check for LED_COLOR_ID_MULTI 2023-09-19 15:16:23 +01:00
macintosh powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
mailbox mailbox: qcom-ipcc: fix incorrect num_chans counting 2023-09-05 10:11:01 -05:00
mcb mcb: remove is_added flag from mcb_device struct 2023-10-05 09:50:14 +02:00
md This push fixes a 6.5 regression in dm-crypt. 2023-10-10 10:47:35 -07:00
media media: i2c: ov8858: Don't set fwnode in the driver 2023-10-11 15:26:16 +02:00
memory memory: tegra: Set BPMP msg flags to reset IPC channels 2023-11-20 11:59:17 +01:00
memstick
message
mfd Couple of small fixes, including: 2023-10-05 11:03:20 -07:00
misc misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support 2023-11-08 11:56:24 +01:00
mmc mmc: core: Capture correct oemid-bits for eMMC cards 2023-09-27 12:17:04 +02:00
most
mtd In the raw NAND subsystem, the major fix prevents using cached reads 2023-10-20 13:12:34 -07:00
mux mux: Explicitly include correct DT includes 2023-08-28 13:36:24 -05:00
net ipvlan: properly track tx_errors 2023-11-20 11:59:04 +01:00
nfc NFC: nxp: add NXP1002 2023-08-30 18:32:24 -07:00
ntb ntb: Check tx descriptors outstanding instead of head/tail for tx queue 2023-08-22 12:38:19 -04:00
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 11:59:19 +01:00
nvme nvme-pci: add BOGUS_NID for Intel 0a54 device 2023-10-18 14:08:39 -07:00
nvmem nvmem: imx: correct nregs for i.MX6ULL 2023-10-16 21:00:08 +02:00
of of: overlay: Reorder struct fragment fields kerneldoc 2023-10-02 11:34:23 -05:00
opp
parisc parisc: iosapic.c: Fix sparse warnings 2023-08-31 21:42:42 +02:00
parport TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
pci PCI: vmd: Correct PCI Header Type Register's multi-function check 2023-11-20 11:59:20 +01:00
pcmcia
peci
perf perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:59:13 +01:00
phy phy fixes for 6.6 2023-10-22 07:11:10 -10:00
pinctrl Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()" 2023-10-19 10:12:48 +02:00
platform platform/chrome: cros_ec_lpc: Separate host command and irq disable 2023-11-20 11:59:08 +01:00
pmdomain pmdomain: imx: scu-pd: correct DMA2 channel 2023-10-05 00:28:52 +02:00
pnp
power power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint 2023-11-08 11:56:20 +01:00
powercap powercap: intel_rapl: Fix invalid setting of Power Limit 4 2023-09-06 22:21:22 +02:00
pps
ps3
ptp ptp: ocp: Fix error handling in ptp_ocp_device_init 2023-10-02 07:19:22 +01:00
pwm pwm: Changes for v6.6-rc1 2023-09-07 18:05:58 -07:00
rapidio
ras
regulator regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve 2023-11-20 11:59:07 +01:00
remoteproc remoteproc updates for v6.6 2023-09-04 15:12:26 -07:00
reset This pull request is full of clk driver changes. In fact, there aren't any 2023-08-30 19:53:39 -07:00
rpmsg rpmsg updates for v6.6 2023-09-04 15:08:52 -07:00
rtc RTC for 6.6 2023-09-07 16:07:35 -07:00
s390 s390 updates for 6.6-rc7 2023-10-21 10:11:11 -07:00
sbus sbus: Explicitly include correct DT includes 2023-08-28 13:36:24 -05:00
scsi scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code 2023-11-20 11:59:19 +01:00
sh
siox
slimbus
soc soc: qcom: pmic_glink: fix connector type to be DisplayPort 2023-11-20 11:59:17 +01:00
soundwire soundwire: bus: Make IRQ handling conditionally built 2023-09-21 11:31:33 +02:00
spi spi: omap2-mcspi: Fix hardcoded reference clock 2023-11-20 11:59:08 +01:00
spmi
ssb
staging staging: media: tegra-video: fix infinite recursion regression 2023-10-02 10:02:53 +02:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-09-27 10:55:29 -04:00
tc
tee ARM: SoC fixes for 6.6, part 2 2023-10-12 11:52:23 -07:00
thermal thermal: core: Don't update trip points inside the hysteresis range 2023-11-20 11:59:01 +01:00
thunderbolt thunderbolt: Fix for v6.6-rc7 2023-10-17 19:25:42 +02:00
tty serial: core: Fix runtime PM handling for pending tx 2023-11-08 11:56:24 +01:00
ufs scsi: ufs: core: Leave space for '\0' in utf8 desc string 2023-11-20 11:59:22 +01:00
uio uio: pruss: fix missing iounmap() in pruss_probe() 2023-08-22 13:41:55 +02:00
usb usb: raw-gadget: properly handle interrupted requests 2023-11-08 11:56:22 +01:00
vdpa vdpa/mlx5: Fix firmware error on creation of 1k VQs 2023-10-18 11:29:41 -04:00
vfio vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() 2023-09-22 12:48:04 -06:00
vhost vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE 2023-10-18 11:29:56 -04:00
video backlight: pwm_bl: Disable PWM on shutdown, suspend and remove 2023-11-20 11:59:20 +01:00
virt minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
virtio virtio_pci: fix the common cfg map size 2023-10-18 11:30:12 -04:00
vlynq
w1 w1: ds2482: Switch back to use struct i2c_driver's .probe() 2023-09-13 10:48:42 +02:00
watchdog linux-watchdog 6.6-rc1 tag 2023-09-06 09:19:12 -07:00
xen xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled 2023-11-20 11:59:12 +01:00
zorro
Kconfig Merge patch series "Add non-coherent DMA support for AX45MP" 2023-09-08 11:24:34 -07:00
Makefile pmdomain: Rename the genpd subsystem to pmdomain 2023-09-13 11:09:21 +02:00