ARM: 9290/1: uaccess: Fix KASAN false-positives
Subsystems (17)
Sasha Levin
maintainerPATCH 1/24 ARM: 9290/1: uaccess: Fix KASAN false-positives
From: Andrew Jeffery <[email protected]>
[ Upstream commit ceac10c83b330680cc01ceaaab86cd49f4f30d81 ]
__copy_to_user_memcpy() and __clear_user_memset() had been calling memcpy() and memset() respectively, leading to false-positive KASAN reports when starting userspace:
[ 10.707901] Run /init as init process
[ 10.731892] process '/bin/busybox' started with executable stack
[ 10.745234] ==================================================================
[ 10.745796] BUG: KASAN: user-memory-access in __clear_user_memset+0x258/0x3ac
[ 10.747260] Write of size 2687 at addr 000de581 by task init/1Use __memcpy() and __memset() instead to allow userspace access, which is of course the intent of these functions.
--- arch/arm/lib/uaccess_with_memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/lib/uaccess_with_memcpy.c +2 -2
@@ -116,7 +116,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) tocopy = n; ua_flags =uaccess_save_and_enable (); -memcpy ((void *)to, from, tocopy); +__memcpy ((void *)to, from, tocopy);uaccess_restore (ua_flags); to += tocopy; from += tocopy;
@@ -178,7 +178,7 @@ __clear_user_memset(void __user *addr, unsigned long n) tocopy = n; ua_flags =uaccess_save_and_enable (); -memset ((void *)addr,0 , tocopy); +__memset ((void *)addr,0 , tocopy);uaccess_restore (ua_flags); addr += tocopy; n -= tocopy;
Signature · 7 lines
2.39.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 2/24 ARM: dts: qcom: apq8026-lg-lenok: add missing reserved memory
From: Luca Weiss <[email protected]>
[ Upstream commit ecd240875e877d78fd03efbc62292f550872df3f ]
Turns out these two memory regions also need to be avoided, otherwise weird things will happen when Linux tries to use this memory.
--- arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts +10 -0
@@ -26,6 +26,16 @@ chosen { }; reserved-memory { + sbl_region: sbl@2f00000 { + reg = <0x02f00000 0x100000>; + no-map; + }; + + external_image_region: external-image@3100000 { + reg = <0x03100000 0x200000>; + no-map; + }; + adsp_region: adsp@3300000 { reg = <0x03300000 0x1400000>; no-map;
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 3/24 power: supply: rk817: Fix unsigned comparison with less than zero
In reply to Sasha LevinFrom: Jiapeng Chong <[email protected]>
[ Upstream commit 3268a4d9b0b85a4382e93bdf7be5400a73db74c5 ]
The tmp is defined as u32 type, which results in invalid processing of tmp<0 in function rk817_read_or_set_full_charge_on_boot(). Therefore, drop the comparison.
drivers/power/supply/rk817_charger.c:828 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero. drivers/power/supply/rk817_charger.c:788 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero.
--- drivers/power/supply/rk817_charger.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/power/supply/rk817_charger.c +0 -4
@@ -785,8 +785,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_Q_PRES_H3 , bulk_reg,4 ); tmp =get_unaligned_be32 (bulk_reg); -if (tmp <0 ) - tmp =0 ; boot_charge_mah =ADC_TO_CHARGE_UAH (tmp, charger->res_div) /1000 ;/*
@@ -825,8 +823,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_Q_PRES_H3 , bulk_reg,4 ); tmp =get_unaligned_be32 (bulk_reg); -if (tmp <0 ) - tmp =0 ; boot_charge_mah =ADC_TO_CHARGE_UAH (tmp, charger->res_div) /1000 ;regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_OCV_VOL_H , bulk_reg,2 );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 4/24 power: supply: cros_usbpd: reclassify "default case!" as debug
In reply to Sasha LevinFrom: Grant Grundler <[email protected]>
[ Upstream commit 14c76b2e75bca4d96e2b85a0c12aa43e84fe3f74 ]
This doesn't need to be printed every second as an error:
...
<3>[17438.628385] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case! <3>[17439.634176] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case! <3>[17440.640298] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case!
...
Reduce priority from ERROR to DEBUG.
--- drivers/power/supply/cros_usbpd-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/cros_usbpd-charger.c +1 -1
@@ -276,7 +276,7 @@ static int cros_usbpd_charger_get_power_info(struct port_data *port) port->psy_current_max =0 ;break ;default : -dev_err (dev,"Port %d: default case!\n" , port->port_number); +dev_dbg (dev,"Port %d: default case!\n" , port->port_number); port->psy_usb_type =POWER_SUPPLY_USB_TYPE_SDP ; }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 5/24 power: supply: axp288_fuel_gauge: Added check for negative values
In reply to Sasha LevinFrom: Denis Arefev <[email protected]>
[ Upstream commit bf6c880d5d1448489ebf92e2d13d5713ff644930 ]
Variable 'pirq', which may receive negative value in platform_get_irq().
Used as an index in a function regmap_irq_get_virq().
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/power/supply/axp288_fuel_gauge.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/power/supply/axp288_fuel_gauge.c +2 -0
@@ -724,6 +724,8 @@ static int axp288_fuel_gauge_probe(struct platform_device *pdev)for (i =0 ; i <AXP288_FG_INTR_NUM ; i++) { pirq =platform_get_irq (pdev, i); +if (pirq <0 ) +continue ; ret =regmap_irq_get_virq (axp20x->regmap_irqc, pirq);if (ret <0 )return dev_err_probe (dev, ret,"getting vIRQ %d\n" , pirq);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 6/24 selftests/bpf: Fix progs/find_vma_fail1.c build error.
In reply to Sasha LevinFrom: Alexei Starovoitov <[email protected]>
[ Upstream commit 32513d40d908b267508d37994753d9bd1600914b ]
The commit 11e456cae91e ("selftests/bpf: Fix compilation errors: Assign a value to a constant") fixed the issue cleanly in bpf-next.
This is an alternative fix in bpf tree to avoid merge conflict between bpf and bpf-next.
--- tools/testing/selftests/bpf/progs/find_vma_fail1.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/progs/find_vma_fail1.c +1 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2021 Facebook */ #include "vmlinux.h" #include <bpf/bpf_helpers.h> +#define vm_flags vm_start char _license[] SEC("license") = "GPL";
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 7/24 wifi: mwifiex: mark OF related data as maybe unused
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 139f6973bf140c65d4d1d4bde5485badb4454d7a ]
The driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/net/wireless/marvell/mwifiex/sdio.c:498:34: error: ‘mwifiex_sdio_of_match_table’ defined but not used [-Werror=unused-const-variable=] drivers/net/wireless/marvell/mwifiex/pcie.c:175:34: error: ‘mwifiex_pcie_of_match_table’ defined but not used [-Werror=unused-const-variable=]
--- drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +1 -1
@@ -172,7 +172,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8997 = { .can_ext_scan = true, }; -static const struct of_device_id mwifiex_pcie_of_match_table[] = { +static const struct of_device_id mwifiex_pcie_of_match_table[]__maybe_unused = { { .compatible ="pci11ab,2b42" }, { .compatible ="pci1b4b,2b42" }, { }
drivers/net/wireless/marvell/mwifiex/sdio.c +1 -1
@@ -479,7 +479,7 @@ static struct memory_type_mapping mem_type_mapping_tbl[] = { {"EXTLAST", NULL, 0, 0xFE}, }; -static const struct of_device_id mwifiex_sdio_of_match_table[] = { +static const struct of_device_id mwifiex_sdio_of_match_table[]__maybe_unused = { { .compatible ="marvell,sd8787" }, { .compatible ="marvell,sd8897" }, { .compatible = "marvell,sd8997" },
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 8/24 i2c: imx-lpi2c: clean rx/tx buffers upon new message
In reply to Sasha LevinFrom: Alexander Stein <[email protected]>
[ Upstream commit 987dd36c0141f6ab9f0fbf14d6b2ec3342dedb2f ]
When start sending a new message clear the Rx & Tx buffer pointers in order to avoid using stale pointers.
--- drivers/i2c/busses/i2c-imx-lpi2c.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-imx-lpi2c.c +2 -0
@@ -463,6 +463,8 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,if (num ==1 && msgs[0 ].len ==0 ) goto stop; + lpi2c_imx->rx_buf =NULL ; + lpi2c_imx->tx_buf =NULL ; lpi2c_imx->delivered =0 ; lpi2c_imx->msglen = msgs[i].len;init_completion (&lpi2c_imx->complete);
Signature · 7 lines
2.39.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 9/24 i2c: hisi: Avoid redundant interrupts
In reply to Sasha LevinFrom: Yicong Yang <[email protected]>
[ Upstream commit cc9812a3096d1986caca9a23bee99effc45c08df ]
After issuing all the messages we can disable the TX_EMPTY interrupts to avoid handling redundant interrupts. For doing a sinlge bus detection (i2cdetect -y -r 0) we can reduce ~97% interrupts (before ~12000 after ~400).
--- drivers/i2c/busses/i2c-hisi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/i2c/busses/i2c-hisi.c +7 -0
@@ -314,6 +314,13 @@ static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr) max_write == 0)break ; } + +/* +* Disable the TX_EMPTY interrupt after finishing all the messages to +* avoid overwhelming the CPU. +*/ +if (ctlr->msg_tx_idx == ctlr->msg_num) +hisi_i2c_disable_int (ctlr,HISI_I2C_INT_TX_EMPTY ); }static irqreturn_t hisi_i2c_irq (int irq,void *context)
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 10/24 efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 5ed213dd64681f84a01ceaa82fb336cf7d59ddcf ]
Another Lenovo convertable which reports a landscape resolution of 1920x1200 with a pitch of (1920 * 4) bytes, while the actual framebuffer has a resolution of 1200x1920 with a pitch of (1200 * 4) bytes.
--- drivers/firmware/efi/sysfb_efi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/firmware/efi/sysfb_efi.c +8 -0
@@ -272,6 +272,14 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { "IdeaPad Duet 3 10IGL5"), }, }, + { + /* Lenovo Yoga Book X91F / X91L */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), + /* Non exact match to match F + L versions */ + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), + }, + }, {}, };
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 11/24 block: ublk_drv: mark device as LIVE before adding disk
In reply to Sasha LevinFrom: Ming Lei <[email protected]>
[ Upstream commit 4985e7b2c002eb4c5c794a1d3acd91b82c89a0fd ]
IO can be started before add_disk() returns, such as reading parititon table, then the monitor work should work for making forward progress.
So mark device as LIVE before adding disk, meantime change to DEAD if add_disk() fails.
Fixed: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
--- drivers/block/ublk_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/block/ublk_drv.c +2 -1
@@ -1548,17 +1548,18 @@ static int ublk_ctrl_start_dev(struct io_uring_cmd *cmd)set_bit (GD_SUPPRESS_PART_SCAN , &disk->state);get_device (&ub->cdev_dev); + ub->dev_info.state =UBLK_S_DEV_LIVE ; ret =add_disk (disk);if (ret) {/* * Has to drop the reference since ->free_disk won't be * called in case of add_disk failure. */ + ub->dev_info.state =UBLK_S_DEV_DEAD ;ublk_put_device (ub); goto out_put_disk; }set_bit (UB_STATE_USED , &ub->state); - ub->dev_info.state =UBLK_S_DEV_LIVE ; out_put_disk:if (ret)put_disk (disk);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 12/24 ACPI: video: Add backlight=native DMI quirk for Acer Aspire 3830TG
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 5e7a3bf65db57461d0f47955248fcadf37321a74 ]
The Acer Aspire 3830TG predates Windows 8, so it defaults to using acpi_video# for backlight control, but this is non functional on this model.
Add a DMI quirk to use the native backlight interface which does work properly.
--- drivers/acpi/video_detect.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/video_detect.c +8 -0
@@ -493,6 +493,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), }, }, + { + .callback = video_detect_force_native, +/* Acer Aspire 3830TG */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3830TG"), + }, + }, { .callback = video_detect_force_native,/* Acer Aspire 4810T */
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 13/24 drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 03aecb1acbcd7a660f97d645ca6c09d9de27ff9d ]
Like the Windows Lenovo Yoga Book X91F/L the Android Lenovo Yoga Book X90F/L has a portrait 1200x1920 screen used in landscape mode, add a quirk for this.
When the quirk for the X91F/L was initially added it was written to also apply to the X90F/L but this does not work because the Android version of the Yoga Book uses completely different DMI strings. Also adjust the X91F/L quirk to reflect that it only applies to the X91F/L models.
--- drivers/gpu/drm/drm_panel_orientation_quirks.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_panel_orientation_quirks.c +10 -3
@@ -328,10 +328,17 @@ static const struct dmi_system_id orientation_data[] = { DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, - }, { /* Lenovo Yoga Book X90F / X91F / X91L */ + }, { /* Lenovo Yoga Book X90F / X90L */ .matches = { -/* Non exact match to match all versions */ - DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"), +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel Corporation" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"CHERRYVIEW D1 PLATFORM" ), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), + }, + .driver_data = (void *)&lcd1200x1920_rightside_up, + }, { /* Lenovo Yoga Book X91F / X91L */ + .matches = { +/* Non exact match to match F + L versions */ + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, }, { /* Lenovo Yoga Tablet 2 830F / 830L */
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 14/24 hwmon: (peci/cputemp) Fix miscalculated DTS for SKX
In reply to Sasha LevinFrom: Iwona Winiarska <[email protected]>
[ Upstream commit 2b91c4a870c9830eaf95e744454c9c218cccb736 ]
For Skylake, DTS temperature of the CPU is reported in S10.6 format instead of S8.8.
--- drivers/hwmon/peci/cputemp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/peci/cputemp.c +7 -1
@@ -537,6 +537,12 @@ static const struct cpu_info cpu_hsx = { .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, }; +static const struct cpu_info cpu_skx = { + .reg = &resolved_cores_reg_hsx, + .min_peci_revision =0x33 , + .thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree, +}; +static const struct cpu_info cpu_icx = { .reg = &resolved_cores_reg_icx, .min_peci_revision =0x40 ,
@@ -558,7 +564,7 @@ static const struct auxiliary_device_id peci_cputemp_ids[] = { }, { .name = "peci_cpu.cputemp.skx", - .driver_data = (kernel_ulong_t)&cpu_hsx, + .driver_data = (kernel_ulong_t)&cpu_skx, }, { .name = "peci_cpu.cputemp.icx",
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 15/24 hwmon: (xgene) Fix ioremap and memremap leak
In reply to Sasha LevinFrom: Tianyi Jing <[email protected]>
[ Upstream commit 813cc94c7847ae4a17e9f744fb4dbdf7df6bd732 ]
Smatch reports:
drivers/hwmon/xgene-hwmon.c:757 xgene_hwmon_probe() warn:
'ctx->pcc_comm_addr' from ioremap() not released on line: 757.
This is because in drivers/hwmon/xgene-hwmon.c:701 xgene_hwmon_probe(), ioremap and memremap is not released, which may cause a leak.
To fix this, ioremap and memremap is modified to devm_ioremap and devm_memremap.
--- drivers/hwmon/xgene-hwmon.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/hwmon/xgene-hwmon.c +7 -7
@@ -698,14 +698,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev) ctx->comm_base_addr = pcc_chan->shmem_base_addr;if (ctx->comm_base_addr) {if (version ==XGENE_HWMON_V2 ) - ctx->pcc_comm_addr = (void __force *)ioremap ( - ctx->comm_base_addr, - pcc_chan->shmem_size); + ctx->pcc_comm_addr = (void __force *)devm_ioremap (&pdev->dev, + ctx->comm_base_addr, + pcc_chan->shmem_size);else - ctx->pcc_comm_addr =memremap ( - ctx->comm_base_addr, - pcc_chan->shmem_size, -MEMREMAP_WB ); + ctx->pcc_comm_addr =devm_memremap (&pdev->dev, + ctx->comm_base_addr, + pcc_chan->shmem_size, +MEMREMAP_WB ); }else {dev_err (&pdev->dev,"Failed to get PCC comm region\n" ); rc = -ENODEV ;
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 16/24 verify_pefile: relax wrapper length check
In reply to Sasha LevinFrom: Robbie Harwood <[email protected]>
[ Upstream commit 4fc5c74dde69a7eda172514aaeb5a7df3600adb3 ]
The PE Format Specification (section "The Attribute Certificate Table (Image Only)") states that dwLength is to be rounded up to 8-byte alignment when used for traversal. Therefore, the field is not required to be an 8-byte multiple in the first place.
Accordingly, pesign has not performed this alignment since version 0.110. This causes kexec failure on pesign'd binaries with "PEFILE:
Signature wrapper len wrong". Update the comment and relax the check.
--- crypto/asymmetric_keys/verify_pefile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
crypto/asymmetric_keys/verify_pefile.c +8 -4
@@ -135,11 +135,15 @@ static int pefile_strip_sig_wrapper(const void *pebuf,pr_debug ("sig wrapper = { %x, %x, %x }\n" , wrapper.length, wrapper.revision, wrapper.cert_type); -/* Both pesign and sbsign round up the length of certificate table -* (in optional header data directories) to 8 byte alignment. +/* sbsign rounds up the length of certificate table (in optional +* header data directories) to 8 byte alignment. However, the PE +* specification states that while entries are 8-byte aligned, this is +* not included in their length, and as a result, pesign has not +* rounded up since 0.110. */ -if (round_up (wrapper.length,8 ) != ctx->sig_len) { -pr_debug ("Signature wrapper len wrong\n" ); +if (wrapper.length > ctx->sig_len) { +pr_debug ("Signature wrapper bigger than sig len (%x > %x)\n" , + ctx->sig_len, wrapper.length);return -ELIBBAD ; }if (wrapper.revision !=WIN_CERT_REVISION_2_0 ) {
Signature · 7 lines
2.39.2 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Sasha Levin
maintainerPATCH 17/24 asymmetric_keys: log on fatal failures in PE/pkcs7
In reply to Sasha LevinFrom: Robbie Harwood <[email protected]>
[ Upstream commit 3584c1dbfffdabf8e3dc1dd25748bb38dd01cd43 ]
These particular errors can be encountered while trying to kexec when secureboot lockdown is in place. Without this change, even with a signed debug build, one still needs to reboot the machine to add the appropriate dyndbg parameters (since lockdown blocks debugfs).
Accordingly, upgrade all pr_debug() before fatal error into pr_warn().
--- crypto/asymmetric_keys/pkcs7_verify.c | 10 +++++----- crypto/asymmetric_keys/verify_pefile.c | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-)
crypto/asymmetric_keys/pkcs7_verify.c +5 -5
@@ -79,16 +79,16 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7, }if (sinfo->msgdigest_len != sig->digest_size) { -pr_debug ("Sig %u: Invalid digest size (%u)\n" , - sinfo->index, sinfo->msgdigest_len); +pr_warn ("Sig %u: Invalid digest size (%u)\n" , + sinfo->index, sinfo->msgdigest_len); ret = -EBADMSG ; goto error; }if (memcmp (sig->digest, sinfo->msgdigest, sinfo->msgdigest_len) !=0 ) { -pr_debug ("Sig %u: Message digest doesn't match\n" , - sinfo->index); +pr_warn ("Sig %u: Message digest doesn't match\n" , + sinfo->index); ret = -EKEYREJECTED ; goto error; }
@@ -478,7 +478,7 @@ int pkcs7_supply_detached_data(struct pkcs7_message *pkcs7, const void *data, size_t datalen) { if (pkcs7->data) { -pr_debug ("Data already supplied\n" ); +pr_warn ("Data already supplied\n" );return -EINVAL ; } pkcs7->data = data;
crypto/asymmetric_keys/verify_pefile.c +12 -12
@@ -74,7 +74,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,break ;default : -pr_debug ("Unknown PEOPT magic = %04hx\n" , pe32->magic); +pr_warn ("Unknown PEOPT magic = %04hx\n" , pe32->magic);return -ELIBBAD ; }
@@ -95,7 +95,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen, ctx->certs_size = ddir->certs.size;if (!ddir->certs.virtual_address || !ddir->certs.size) { -pr_debug ("Unsigned PE binary\n" ); +pr_warn ("Unsigned PE binary\n" );return -ENODATA ; }
@@ -127,7 +127,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf,unsigned len;if (ctx->sig_len <sizeof (wrapper)) { -pr_debug ("Signature wrapper too short\n" ); +pr_warn ("Signature wrapper too short\n" );return -ELIBBAD ; }
@@ -142,16 +142,16 @@ static int pefile_strip_sig_wrapper(const void *pebuf,* rounded up since 0.110. */ if (wrapper.length > ctx->sig_len) { -pr_debug ("Signature wrapper bigger than sig len (%x > %x)\n" , - ctx->sig_len, wrapper.length); +pr_warn ("Signature wrapper bigger than sig len (%x > %x)\n" , + ctx->sig_len, wrapper.length);return -ELIBBAD ; }if (wrapper.revision !=WIN_CERT_REVISION_2_0 ) { -pr_debug ("Signature is not revision 2.0\n" ); +pr_warn ("Signature is not revision 2.0\n" );return -ENOTSUPP ; }if (wrapper.cert_type !=WIN_CERT_TYPE_PKCS_SIGNED_DATA ) { -pr_debug ("Signature certificate type is not PKCS\n" ); +pr_warn ("Signature certificate type is not PKCS\n" );return -ENOTSUPP ; }
@@ -164,7 +164,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf, ctx->sig_offset +=sizeof (wrapper); ctx->sig_len -=sizeof (wrapper);if (ctx->sig_len <4 ) { -pr_debug ("Signature data missing\n" ); +pr_warn ("Signature data missing\n" );return -EKEYREJECTED ; }
@@ -198,7 +198,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf,return 0 ; } not_pkcs7: -pr_debug ("Signature data not PKCS#7\n" ); +pr_warn ("Signature data not PKCS#7\n" );return -ELIBBAD ; }
@@ -341,8 +341,8 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen, digest_size =crypto_shash_digestsize (tfm);if (digest_size != ctx->digest_len) { -pr_debug ("Digest size mismatch (%zx != %x)\n" , - digest_size, ctx->digest_len); +pr_warn ("Digest size mismatch (%zx != %x)\n" , + digest_size, ctx->digest_len); ret = -EBADMSG ; goto error_no_desc; }
@@ -373,7 +373,7 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen,* PKCS#7 certificate. */ if (memcmp (digest, ctx->digest, ctx->digest_len) !=0 ) { -pr_debug ("Digest mismatch\n" ); +pr_warn ("Digest mismatch\n" ); ret = -EKEYREJECTED ; }else {pr_debug ("The digests match!\n" );
Signature · 7 lines
2.39.2 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Sasha Levin
maintainerPATCH 18/24 nvme: send Identify with CNS 06h only to I/O controllers
In reply to Sasha LevinFrom: Martin George <[email protected]>
[ Upstream commit def84ab600b71ea3fcc422a876d5d0d0daa7d4f3 ]
Identify CNS 06h (I/O Command Set Specific Identify Controller data structure) is supported only on i/o controllers.
But nvme_init_non_mdts_limits() currently invokes this on all controllers. Correct this by ensuring this is sent to I/O controllers only.
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
@@ -3074,7 +3074,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)else ctrl->max_zeroes_sectors =0 ; -if (nvme_ctrl_limited_cns (ctrl)) +if (ctrl->subsys->subtype !=NVME_NQN_NVME || +nvme_ctrl_limited_cns (ctrl))return 0 ; id =kzalloc (sizeof (*id),GFP_KERNEL );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 19/24 wifi: iwlwifi: mvm: fix mvmtxq->stopped handling
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit b58e3d4311b54b6dd0e37165277965da0c9eb21d ]
This could race if the queue is redirected while full, then the flushing internally would start it while it's not yet usable again. Fix it by using two state bits instead of just one.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +4 -1
@@ -729,7 +729,10 @@ void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)rcu_read_lock (); do { - while (likely(!mvmtxq->stopped && + while (likely(!test_bit(IWL_MVM_TXQ_STATE_STOP_FULL, + &mvmtxq->state) && + !test_bit(IWL_MVM_TXQ_STATE_STOP_REDIRECT, + &mvmtxq->state) && !test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))) { skb = ieee80211_tx_dequeue(hw, txq);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -1
@@ -729,7 +729,9 @@ struct iwl_mvm_txq {struct list_head list;u16 txq_id;atomic_t tx_request; -bool stopped; +#define IWL_MVM_TXQ_STATE_STOP_FULL 0 +#define IWL_MVM_TXQ_STATE_STOP_REDIRECT 1 +unsigned long state; }; static inline struct iwl_mvm_txq *
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +4 -1
@@ -1680,7 +1680,10 @@ static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, txq = sta->txq[tid]; mvmtxq =iwl_mvm_txq_from_mac80211 (txq); - mvmtxq->stopped = !start; +if (start) +clear_bit (IWL_MVM_TXQ_STATE_STOP_FULL , &mvmtxq->state); +else +set_bit (IWL_MVM_TXQ_STATE_STOP_FULL , &mvmtxq->state);if (start && mvmsta->sta_state !=IEEE80211_STA_NOTEXIST )iwl_mvm_mac_itxq_xmit (mvm->hw, txq);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -2
@@ -692,7 +692,7 @@ static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, queue, iwl_mvm_ac_to_tx_fifo[ac]);/* Stop the queue and wait for it to empty */ - txq->stopped = true; +set_bit (IWL_MVM_TXQ_STATE_STOP_REDIRECT , &txq->state); ret =iwl_trans_wait_tx_queues_empty (mvm->trans,BIT (queue));if (ret) {
@@ -735,7 +735,7 @@ static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, out:/* Continue using the queue */ - txq->stopped = false; +clear_bit (IWL_MVM_TXQ_STATE_STOP_REDIRECT , &txq->state);return ret; }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 20/24 wifi: iwlwifi: mvm: protect TXQ list manipulation
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 923bf981eb6ecc027227716e30701bdcc1845fbf ]
Some recent upstream debugging uncovered the fact that in iwlwifi, the TXQ list manipulation is racy.
Introduce a new state bit for when the TXQ is completely ready and can be used without locking, and if that's not set yet acquire the lock to check everything correctly.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 45 ++++++------------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 25 +++++++++-- 4 files changed, 39 insertions(+), 34 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +14 -31
@@ -757,42 +757,25 @@ static void iwl_mvm_mac_wake_tx_queue(struct ieee80211_hw *hw,struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_mac80211 (txq); -/* -* Please note that racing is handled very carefully here: -* mvmtxq->txq_id is updated during allocation, and mvmtxq->list is -* deleted afterwards. -* This means that if: -* mvmtxq->txq_id != INVALID_QUEUE && list_empty(&mvmtxq->list): -* queue is allocated and we can TX. -* mvmtxq->txq_id != INVALID_QUEUE && !list_empty(&mvmtxq->list): -* a race, should defer the frame. -* mvmtxq->txq_id == INVALID_QUEUE && list_empty(&mvmtxq->list): -* need to allocate the queue and defer the frame. -* mvmtxq->txq_id == INVALID_QUEUE && !list_empty(&mvmtxq->list): -* queue is already scheduled for allocation, no need to allocate, -* should defer the frame. -*/ - -/* If the queue is allocated TX and return. */ -if (!txq->sta || mvmtxq->txq_id !=IWL_MVM_INVALID_QUEUE ) { -/* -* Check that list is empty to avoid a race where txq_id is -* already updated, but the queue allocation work wasn't -* finished -*/ -if (unlikely (txq->sta && !list_empty (&mvmtxq->list))) -return ; - +if (likely (test_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state)) || + !txq->sta) {iwl_mvm_mac_itxq_xmit (hw, txq);return ; } -/* The list is being deleted only after the queue is fully allocated. */ -if (!list_empty (&mvmtxq->list)) -return ; +/* iwl_mvm_mac_itxq_xmit() will later be called by the worker +* to handle any packets we leave on the txq now +*/ -list_add_tail (&mvmtxq->list, &mvm->add_stream_txqs); -schedule_work (&mvm->add_stream_wk); +spin_lock_bh (&mvm->add_stream_lock); +/* The list is being deleted only after the queue is fully allocated. */ +if (list_empty (&mvmtxq->list) && +/* recheck under lock */ + !test_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state)) { +list_add_tail (&mvmtxq->list, &mvm->add_stream_txqs); +schedule_work (&mvm->add_stream_wk); + } +spin_unlock_bh (&mvm->add_stream_lock); } #define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -731,6 +731,7 @@ struct iwl_mvm_txq {atomic_t tx_request;#define IWL_MVM_TXQ_STATE_STOP_FULL 0#define IWL_MVM_TXQ_STATE_STOP_REDIRECT 1 +#define IWL_MVM_TXQ_STATE_READY 2unsigned long state; };
@@ -829,6 +830,7 @@ struct iwl_mvm {struct iwl_mvm_tvqm_txq_info tvqm_info[IWL_MAX_TVQM_QUEUES ]; };struct work_struct add_stream_wk;/* To add streams to queues */ +spinlock_t add_stream_lock;const char *nvm_file_name;struct iwl_nvm_data *nvm_data;
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -0
@@ -1184,6 +1184,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,INIT_DELAYED_WORK (&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk);INIT_WORK (&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk);INIT_LIST_HEAD (&mvm->add_stream_txqs); +spin_lock_init (&mvm->add_stream_lock);init_waitqueue_head (&mvm->rx_sync_waitq);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +22 -3
@@ -383,8 +383,11 @@ static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta,struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_tid (sta, tid); - mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); + mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_unlock_bh (&mvm->add_stream_lock); }/* Regardless if this is a reserved TXQ for a STA - mark it as false */
@@ -478,8 +481,11 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) disable_agg_tids |=BIT (tid); mvmsta->tid_data[tid].txq_id =IWL_MVM_INVALID_QUEUE ; - mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); + mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_unlock_bh (&mvm->add_stream_lock); } mvmsta->tfd_queue_msk &= ~BIT (queue);/* Don't use this queue anymore */
@@ -1443,12 +1449,22 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk)* a queue in the function itself. */ if (iwl_mvm_sta_alloc_queue (mvm, txq->sta, txq->ac, tid)) { +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +spin_unlock_bh (&mvm->add_stream_lock);continue ; } -list_del_init (&mvmtxq->list); +/* now we're ready, any remaining races/concurrency will be +* handled in iwl_mvm_mac_itxq_xmit() +*/ +set_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); +local_bh_disable (); +spin_lock (&mvm->add_stream_lock); +list_del_init (&mvmtxq->list); +spin_unlock (&mvm->add_stream_lock); +iwl_mvm_mac_itxq_xmit (mvm->hw, txq);local_bh_enable (); }
@@ -1862,8 +1878,11 @@ static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm,struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_mac80211 (sta->txq[i]); +spin_lock_bh (&mvm->add_stream_lock); mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ;list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); +spin_unlock_bh (&mvm->add_stream_lock); } }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 21/24 drm/amdgpu: add mes resume when do gfx post soft reset
In reply to Sasha LevinFrom: Tong Liu01 <[email protected]>
[ Upstream commit 4eb0b49a0ad3e004a6a65b84efe37bc7e66d560f ]
[why]
when gfx do soft reset, mes will also do reset, if mes is not resumed when do recover from soft reset, mes is unable to respond in later sequence
[how]
resume mes when do gfx post soft reset
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +9 -0
@@ -4625,6 +4625,14 @@ static bool gfx_v11_0_check_soft_reset(void *handle)return false; } +static int gfx_v11_0_post_soft_reset (void *handle) +{ +/** +* GFX soft reset will impact MES, need resume MES when do GFX soft reset +*/ +return amdgpu_mes_resume ((struct amdgpu_device *)handle); +} +static uint64_t gfx_v11_0_get_gpu_clock_counter (struct amdgpu_device *adev) {uint64_t clock;
@@ -6068,6 +6076,7 @@ static const struct amd_ip_funcs gfx_v11_0_ip_funcs = { .wait_for_idle = gfx_v11_0_wait_for_idle, .soft_reset = gfx_v11_0_soft_reset, .check_soft_reset = gfx_v11_0_check_soft_reset, + .post_soft_reset = gfx_v11_0_post_soft_reset, .set_clockgating_state = gfx_v11_0_set_clockgating_state, .set_powergating_state = gfx_v11_0_set_powergating_state, .get_clockgating_state = gfx_v11_0_get_clockgating_state,
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 22/24 drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs
In reply to Sasha LevinFrom: YuBiao Wang <[email protected]>
[ Upstream commit 033c56474acf567a450f8bafca50e0b610f2b716 ]
[Why]
For engines not supporting soft reset, i.e. VCN, there will be a failed ib test before mode 1 reset during asic reset. The fences in this case are never signaled and next time when we try to free the sa_bo, kernel will hang.
[How]
During pre_asic_reset, driver will clear job fences and afterwards the fences' refcount will be reduced to 1. For drm_sched_jobs it will be released in job_free_cb, and for non-sched jobs like ib_test, it's meant to be released in sa_bo_free but only when the fences are signaled. So we have to force signal the non_sched bad job's fence during pre_asic_reset or the clear is not complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +9 -0
@@ -624,6 +624,15 @@ void amdgpu_fence_driver_clear_job_fences(struct amdgpu_ring *ring) ptr = &ring->fence_drv.fences[i]; old =rcu_dereference_protected (*ptr,1 );if (old && old->ops == &amdgpu_job_fence_ops) { +struct amdgpu_job *job; + +/* For non-scheduler bad job, i.e. failed ib test, we need to signal +* it right here or we won't be able to track them in fence_drv +* and they will remain unsignaled during sa_bo free. +*/ + job = container_of(old, struct amdgpu_job, hw_fence); +if (!job->base.s_fence && !dma_fence_is_signaled (old)) +dma_fence_signal (old);RCU_INIT_POINTER (*ptr,NULL );dma_fence_put (old); }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 23/24 drm/amdgpu/gfx: set cg flags to enter/exit safe mode
In reply to Sasha LevinFrom: Jane Jian <[email protected]>
[ Upstream commit e06bfcc1a1c41bcb8c31470d437e147ce9f0acfd ]
sriov needs to enter/exit safe mode in update umd p state add the cg flag to let it enter or exit while needed
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +5 -0
@@ -1316,6 +1316,11 @@ static int gfx_v11_0_sw_init(void *handle)break ; } +/* Enable CG flag in one VF mode for enabling RLC safe mode enter/exit */ +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (11 ,0 ,3 ) && +amdgpu_sriov_is_pp_one_vf (adev)) + adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG ; +/* EOP Event */ r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP, GFX_11_0_0__SRCID__CP_EOP_INTERRUPT,
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 24/24 ACPI: resource: Add Medion S17413 to IRQ override quirk
In reply to Sasha LevinFrom: Aymeric Wibo <[email protected]>
[ Upstream commit 2d0ab14634a26e54f8d6d231b47b7ef233e84599 ]
Add DMI info of the Medion S17413 (board M1xA) to the IRQ override quirk table. This fixes the keyboard not working on these laptops.
--- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/acpi/resource.c +7 -0
@@ -400,6 +400,13 @@ static const struct dmi_system_id medion_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "M17T"), }, }, + { + .ident = "MEDION S17413", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), + DMI_MATCH(DMI_BOARD_NAME, "M1xA"), + }, + }, { } };
Signature · 1 line
2.39.2