linux/drivers/firmware
Jann Horn b9472f7d82 firmware: xilinx: fix debugfs write handler
- Userspace wants to write a string with `len` bytes, not counting the
   terminating NULL, so we should allocate `len+1` bytes. It looks like the
   current code relied on having a nullbyte directly behind `kern_buff`,
   which happens to work reliably as long as `len` isn't one of the kmalloc
   size classes.
 - strncpy_from_user() is completely wrong here; userspace is giving us a
   (not necessarily null-terminated) buffer and its length.
   strncpy_from_user() is for cases in which we don't know the length.
 - Don't let broken userspace allocate arbitrarily big kmalloc allocations.

Just use memdup_user_nul(), which is designed precisely for things like
this.

Signed-off-by: Jann Horn <jannh@google.com>
Acked-by: Jolly Shah <jolly.shah@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2019-03-18 13:43:54 +01:00
..
arm_scmi firmware: arm_scmi: provide the mandatory device release callback 2019-01-30 11:34:42 +01:00
broadcom firmware: bcm47xx_nvram: Support small (0x6000 B) NVRAM partitions 2018-04-23 16:39:35 +01:00
efi arm64 updates for 5.1: 2019-03-10 10:17:23 -07:00
google gsmi: Add GSMI commands to log S0ix info 2018-10-15 20:32:26 +02:00
imx firmware: imx: Add support to start/stop a CPU 2019-02-11 10:00:47 +08:00
meson firmware: meson_sm: Add serial number sysfs entry 2018-09-12 20:54:07 -07:00
tegra firmware/tegra: Enable Tegra186 BPMP support on Tegra194 2019-02-07 18:52:39 +01:00
xilinx firmware: xilinx: fix debugfs write handler 2019-03-18 13:43:54 +01:00
Kconfig firmware: intel_stratix10_service: remove COMPILE_TEST 2019-02-01 15:17:51 +01:00
Makefile firmware: add Intel Stratix10 service layer driver 2018-11-26 20:13:50 +01:00
arm_scpi.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
arm_sdei.c firmware: arm_sdei: Add ACPI GHES registration helper 2019-02-11 11:07:49 +01:00
dmi-id.c firmware: dmi: Add access to the SKU ID string 2018-06-17 14:09:42 +02:00
dmi-sysfs.c firmware: dmi: handle missing DMI data gracefully 2018-02-03 11:25:20 +01:00
dmi_scan.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
edd.c edd: don't spam log if no EDD information is present 2018-03-27 09:51:23 +02:00
iscsi_ibft.c iscsi_ibft: Fix missing break in switch statement 2019-02-12 13:15:36 -05:00
iscsi_ibft_find.c iscsi_ibft: use virt_to_phys instead of isa_virt_to_bus 2019-02-12 13:15:36 -05:00
memmap.c memblock: drop memblock_alloc_*_nopanic() variants 2019-03-12 10:04:02 -07:00
pcdp.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02:00
pcdp.h
psci.c firmware/psci: Expose SMCCC version through psci_ops 2018-02-06 22:54:11 +00:00
psci_checker.c drivers/firmware: psci_checker: stash and use topology_core_cpumask for hotplug tests 2018-07-26 00:16:58 -07:00
qcom_scm-32.c firmware: qcom: scm: Fix crash in qcom_scm_call_atomic1() 2018-05-24 22:36:45 -05:00
qcom_scm-64.c remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qcom_scm.c firmware: qcom: scm: Refactor clock handling 2018-09-14 00:31:52 -05:00
qcom_scm.h remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
qemu_fw_cfg.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
raspberrypi.c firmware: raspberrypi: notify VC4 firmware of a reboot 2019-01-09 16:38:34 +01:00
scpi_pm_domain.c firmware: Convert to using %pOFn instead of device_node.name 2018-10-04 14:16:01 -05:00
stratix10-svc.c firmware: stratix10-svc: fix wrong of_node_put() in init function 2018-12-06 15:42:18 +01:00
ti_sci.c firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro 2019-01-30 10:22:16 -08:00
ti_sci.h firmware: ti_sci: Switch to SPDX Licensing 2018-05-04 23:10:23 -07:00