From ac6e97c4bcfeb6b9f550123b638ea9ffa7641f28 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 19 Jun 2024 08:25:03 -0400 Subject: [PATCH] Fixes for 6.9 Signed-off-by: Sasha Levin --- ...realtek-rts5411-add-missing-addition.patch | 39 +++++++ ...-functionality-flags-of-the-slave-on.patch | 44 +++++++ ...ix-the-functionality-flags-of-the-sl.patch | 46 ++++++++ ...-wrong-invocation-of-acpi-sid-method.patch | 52 +++++++++ ...ci1xxxx-fix-a-memory-leak-in-the-err.patch | 45 ++++++++ ...on-t-use-struct-dw8250_data-outside-.patch | 109 ++++++++++++++++++ queue-6.9/series | 8 ++ ...da-check-whether-the-media-is-initia.patch | 61 ++++++++++ ...sses-clear-tif_notify_signal-along-w.patch | 61 ++++++++++ 9 files changed, 465 insertions(+) create mode 100644 queue-6.9/dt-bindings-usb-realtek-rts5411-add-missing-addition.patch create mode 100644 queue-6.9/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch create mode 100644 queue-6.9/i2c-designware-fix-the-functionality-flags-of-the-sl.patch create mode 100644 queue-6.9/mei-vsc-fix-wrong-invocation-of-acpi-sid-method.patch create mode 100644 queue-6.9/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch create mode 100644 queue-6.9/serial-8250_dw-don-t-use-struct-dw8250_data-outside-.patch create mode 100644 queue-6.9/usb-storage-alauda-check-whether-the-media-is-initia.patch create mode 100644 queue-6.9/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch diff --git a/queue-6.9/dt-bindings-usb-realtek-rts5411-add-missing-addition.patch b/queue-6.9/dt-bindings-usb-realtek-rts5411-add-missing-addition.patch new file mode 100644 index 00000000000..ee41ca22462 --- /dev/null +++ b/queue-6.9/dt-bindings-usb-realtek-rts5411-add-missing-addition.patch @@ -0,0 +1,39 @@ +From 6508ba7af7f3b4d85f4bc869179bcbc2ff59c69b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 May 2024 14:44:59 -0500 +Subject: dt-bindings: usb: realtek,rts5411: Add missing "additionalProperties" + on child nodes + +From: Rob Herring (Arm) + +[ Upstream commit e4228cfd092351c2d9b1a3048b2070287291ccbb ] + +All nodes need an explicit additionalProperties or unevaluatedProperties +unless a $ref has one that's false. As that is not the case with +usb-device.yaml, "additionalProperties" is needed here. + +Fixes: c44d9dab31d6 ("dt-bindings: usb: Add downstream facing ports to realtek binding") +Signed-off-by: "Rob Herring (Arm)" +Reviewed-by: Stephen Boyd +Link: https://lore.kernel.org/r/20240523194500.2958192-1-robh@kernel.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + Documentation/devicetree/bindings/usb/realtek,rts5411.yaml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml +index 0874fc21f66fb..6577a61cc0753 100644 +--- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml ++++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml +@@ -65,6 +65,7 @@ patternProperties: + description: The hard wired USB devices + type: object + $ref: /schemas/usb/usb-device.yaml ++ additionalProperties: true + + required: + - peer-hub +-- +2.43.0 + diff --git a/queue-6.9/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch b/queue-6.9/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch new file mode 100644 index 00000000000..fd73ca53630 --- /dev/null +++ b/queue-6.9/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch @@ -0,0 +1,44 @@ +From 9bcdc201c56604b307cb3f801c93e6dc6936a5b0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 May 2024 11:19:14 +0200 +Subject: i2c: at91: Fix the functionality flags of the slave-only interface + +From: Jean Delvare + +[ Upstream commit d6d5645e5fc1233a7ba950de4a72981c394a2557 ] + +When an I2C adapter acts only as a slave, it should not claim to +support I2C master capabilities. + +Fixes: 9d3ca54b550c ("i2c: at91: added slave mode support") +Signed-off-by: Jean Delvare +Cc: Juergen Fitschen +Cc: Ludovic Desroches +Cc: Codrin Ciubotariu +Cc: Andi Shyti +Cc: Nicolas Ferre +Cc: Alexandre Belloni +Cc: Claudiu Beznea +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-at91-slave.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-at91-slave.c b/drivers/i2c/busses/i2c-at91-slave.c +index d6eeea5166c04..131a67d9d4a68 100644 +--- a/drivers/i2c/busses/i2c-at91-slave.c ++++ b/drivers/i2c/busses/i2c-at91-slave.c +@@ -106,8 +106,7 @@ static int at91_unreg_slave(struct i2c_client *slave) + + static u32 at91_twi_func(struct i2c_adapter *adapter) + { +- return I2C_FUNC_SLAVE | I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL +- | I2C_FUNC_SMBUS_READ_BLOCK_DATA; ++ return I2C_FUNC_SLAVE; + } + + static const struct i2c_algorithm at91_twi_algorithm_slave = { +-- +2.43.0 + diff --git a/queue-6.9/i2c-designware-fix-the-functionality-flags-of-the-sl.patch b/queue-6.9/i2c-designware-fix-the-functionality-flags-of-the-sl.patch new file mode 100644 index 00000000000..93ab65ac952 --- /dev/null +++ b/queue-6.9/i2c-designware-fix-the-functionality-flags-of-the-sl.patch @@ -0,0 +1,46 @@ +From 2694d60f401c7ad77debd770d2c89247e6e27d0a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 May 2024 11:17:48 +0200 +Subject: i2c: designware: Fix the functionality flags of the slave-only + interface + +From: Jean Delvare + +[ Upstream commit cbf3fb5b29e99e3689d63a88c3cddbffa1b8de99 ] + +When an I2C adapter acts only as a slave, it should not claim to +support I2C master capabilities. + +Fixes: 5b6d721b266a ("i2c: designware: enable SLAVE in platform module") +Signed-off-by: Jean Delvare +Cc: Luis Oliveira +Cc: Jarkko Nikula +Cc: Andy Shevchenko +Cc: Mika Westerberg +Cc: Jan Dabros +Cc: Andi Shyti +Reviewed-by: Andy Shevchenko +Acked-by: Jarkko Nikula +Tested-by: Jarkko Nikula +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-designware-slave.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c +index 2e079cf20bb5b..78e2c47e3d7da 100644 +--- a/drivers/i2c/busses/i2c-designware-slave.c ++++ b/drivers/i2c/busses/i2c-designware-slave.c +@@ -220,7 +220,7 @@ static const struct i2c_algorithm i2c_dw_algo = { + + void i2c_dw_configure_slave(struct dw_i2c_dev *dev) + { +- dev->functionality = I2C_FUNC_SLAVE | DW_IC_DEFAULT_FUNCTIONALITY; ++ dev->functionality = I2C_FUNC_SLAVE; + + dev->slave_cfg = DW_IC_CON_RX_FIFO_FULL_HLD_CTRL | + DW_IC_CON_RESTART_EN | DW_IC_CON_STOP_DET_IFADDRESSED; +-- +2.43.0 + diff --git a/queue-6.9/mei-vsc-fix-wrong-invocation-of-acpi-sid-method.patch b/queue-6.9/mei-vsc-fix-wrong-invocation-of-acpi-sid-method.patch new file mode 100644 index 00000000000..5ebb209375e --- /dev/null +++ b/queue-6.9/mei-vsc-fix-wrong-invocation-of-acpi-sid-method.patch @@ -0,0 +1,52 @@ +From 2d5f68656ba2c8dfbb969dbab15a44b3d087e104 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Jun 2024 22:50:50 +0200 +Subject: mei: vsc: Fix wrong invocation of ACPI SID method + +From: Hans de Goede + +[ Upstream commit af076156ec6d70332f1555754e99d4a3771ec297 ] + +When using an initializer for a union only one of the union members +must be initialized. The initializer for the acpi_object union variable +passed as argument to the SID ACPI method was initializing both +the type and the integer members of the union. + +Unfortunately rather then complaining about this gcc simply ignores +the first initializer and only used the second integer.value = 1 +initializer. Leaving type set to 0 which leads to the argument being +skipped by acpi acpi_ns_evaluate() resulting in: + +ACPI Warning: \_SB.PC00.SPI1.SPFD.CVFD.SID: Insufficient arguments - +Caller passed 0, method requires 1 (20240322/nsarguments-232) + +Fix this by initializing only the integer struct part of the union +and initializing both members of the integer struct. + +Signed-off-by: Hans de Goede +Reviewed-by: Sakari Ailus +Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") +Reviewed-by: Wentong Wu +Link: https://lore.kernel.org/r/20240603205050.505389-1-hdegoede@redhat.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/mei/vsc-fw-loader.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/misc/mei/vsc-fw-loader.c b/drivers/misc/mei/vsc-fw-loader.c +index ffa4ccd96a104..596a9d695dfc1 100644 +--- a/drivers/misc/mei/vsc-fw-loader.c ++++ b/drivers/misc/mei/vsc-fw-loader.c +@@ -252,7 +252,7 @@ static int vsc_get_sensor_name(struct vsc_fw_loader *fw_loader, + { + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER }; + union acpi_object obj = { +- .type = ACPI_TYPE_INTEGER, ++ .integer.type = ACPI_TYPE_INTEGER, + .integer.value = 1, + }; + struct acpi_object_list arg_list = { +-- +2.43.0 + diff --git a/queue-6.9/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch b/queue-6.9/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch new file mode 100644 index 00000000000..f8c8efcda0a --- /dev/null +++ b/queue-6.9/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch @@ -0,0 +1,45 @@ +From 3db276fa944545768ef73dbf6e6ed99a15148759 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 May 2024 20:14:34 +0800 +Subject: misc: microchip: pci1xxxx: Fix a memory leak in the error handling of + gp_aux_bus_probe() + +From: Yongzhi Liu + +[ Upstream commit 77427e3d5c353e3dd98c7c0af322f8d9e3131ace ] + +There is a memory leak (forget to free allocated buffers) in a +memory allocation failure path. + +Fix it to jump to the correct error handling code. + +Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") +Signed-off-by: Yongzhi Liu +Reviewed-by: Kumaravel Thiagarajan +Link: https://lore.kernel.org/r/20240523121434.21855-4-hyperlyzcs@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +index de75d89ef53e8..34c9be437432a 100644 +--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c ++++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +@@ -69,8 +69,10 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id + + aux_bus->aux_device_wrapper[1] = kzalloc(sizeof(*aux_bus->aux_device_wrapper[1]), + GFP_KERNEL); +- if (!aux_bus->aux_device_wrapper[1]) +- return -ENOMEM; ++ if (!aux_bus->aux_device_wrapper[1]) { ++ retval = -ENOMEM; ++ goto err_aux_dev_add_0; ++ } + + retval = ida_alloc(&gp_client_ida, GFP_KERNEL); + if (retval < 0) +-- +2.43.0 + diff --git a/queue-6.9/serial-8250_dw-don-t-use-struct-dw8250_data-outside-.patch b/queue-6.9/serial-8250_dw-don-t-use-struct-dw8250_data-outside-.patch new file mode 100644 index 00000000000..6dcb5a20526 --- /dev/null +++ b/queue-6.9/serial-8250_dw-don-t-use-struct-dw8250_data-outside-.patch @@ -0,0 +1,109 @@ +From 403a25d51bced97098d5af33ef9300083751faea Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 May 2024 22:05:53 +0300 +Subject: serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw + +From: Andy Shevchenko + +[ Upstream commit 87d80bfbd577912462061b1a45c0ed9c7fcb872f ] + +The container of the struct dw8250_port_data is private to the actual +driver. In particular, 8250_lpss and 8250_dw use different data types +that are assigned to the UART port private_data. Hence, it must not +be used outside the specific driver. + +Currently the only cpr_val is required by the common code, make it +be available via struct dw8250_port_data. + +This fixes the UART breakage on Intel Galileo boards. + +Fixes: 593dea000bc1 ("serial: 8250: dw: Allow to use a fallback CPR value if not synthesized") +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20240514190730.2787071-2-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/tty/serial/8250/8250_dw.c | 9 +++++++-- + drivers/tty/serial/8250/8250_dwlib.c | 3 +-- + drivers/tty/serial/8250/8250_dwlib.h | 3 ++- + 3 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c +index 1300c92b8702a..94d680e4b5353 100644 +--- a/drivers/tty/serial/8250/8250_dw.c ++++ b/drivers/tty/serial/8250/8250_dw.c +@@ -55,6 +55,7 @@ + #define DW_UART_QUIRK_SKIP_SET_RATE BIT(2) + #define DW_UART_QUIRK_IS_DMA_FC BIT(3) + #define DW_UART_QUIRK_APMC0D08 BIT(4) ++#define DW_UART_QUIRK_CPR_VALUE BIT(5) + + static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb) + { +@@ -445,6 +446,10 @@ static void dw8250_prepare_rx_dma(struct uart_8250_port *p) + static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) + { + unsigned int quirks = data->pdata ? data->pdata->quirks : 0; ++ u32 cpr_value = data->pdata ? data->pdata->cpr_value : 0; ++ ++ if (quirks & DW_UART_QUIRK_CPR_VALUE) ++ data->data.cpr_value = cpr_value; + + #ifdef CONFIG_64BIT + if (quirks & DW_UART_QUIRK_OCTEON) { +@@ -727,8 +732,8 @@ static const struct dw8250_platform_data dw8250_armada_38x_data = { + + static const struct dw8250_platform_data dw8250_renesas_rzn1_data = { + .usr_reg = DW_UART_USR, +- .cpr_val = 0x00012f32, +- .quirks = DW_UART_QUIRK_IS_DMA_FC, ++ .cpr_value = 0x00012f32, ++ .quirks = DW_UART_QUIRK_CPR_VALUE | DW_UART_QUIRK_IS_DMA_FC, + }; + + static const struct dw8250_platform_data dw8250_starfive_jh7100_data = { +diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c +index 3e33ddf7bc800..5a2520943dfd5 100644 +--- a/drivers/tty/serial/8250/8250_dwlib.c ++++ b/drivers/tty/serial/8250/8250_dwlib.c +@@ -242,7 +242,6 @@ static const struct serial_rs485 dw8250_rs485_supported = { + void dw8250_setup_port(struct uart_port *p) + { + struct dw8250_port_data *pd = p->private_data; +- struct dw8250_data *data = to_dw8250_data(pd); + struct uart_8250_port *up = up_to_u8250p(p); + u32 reg, old_dlf; + +@@ -278,7 +277,7 @@ void dw8250_setup_port(struct uart_port *p) + + reg = dw8250_readl_ext(p, DW_UART_CPR); + if (!reg) { +- reg = data->pdata->cpr_val; ++ reg = pd->cpr_value; + dev_dbg(p->dev, "CPR is not available, using 0x%08x instead\n", reg); + } + if (!reg) +diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h +index f13e91f2cace9..794a9014cdac1 100644 +--- a/drivers/tty/serial/8250/8250_dwlib.h ++++ b/drivers/tty/serial/8250/8250_dwlib.h +@@ -19,6 +19,7 @@ struct dw8250_port_data { + struct uart_8250_dma dma; + + /* Hardware configuration */ ++ u32 cpr_value; + u8 dlf_size; + + /* RS485 variables */ +@@ -27,7 +28,7 @@ struct dw8250_port_data { + + struct dw8250_platform_data { + u8 usr_reg; +- u32 cpr_val; ++ u32 cpr_value; + unsigned int quirks; + }; + +-- +2.43.0 + diff --git a/queue-6.9/series b/queue-6.9/series index ad7a19916c6..65ccdd55792 100644 --- a/queue-6.9/series +++ b/queue-6.9/series @@ -271,3 +271,11 @@ mm-huge_memory-don-t-unpoison-huge_zero_folio.patch remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch greybus-fix-use-after-free-bug-in-gb_interface_release-due-to-race-condition.patch ima-fix-use-after-free-on-a-dentry-s-dname.name.patch +serial-8250_dw-don-t-use-struct-dw8250_data-outside-.patch +dt-bindings-usb-realtek-rts5411-add-missing-addition.patch +usb-storage-alauda-check-whether-the-media-is-initia.patch +mei-vsc-fix-wrong-invocation-of-acpi-sid-method.patch +misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch +i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch +i2c-designware-fix-the-functionality-flags-of-the-sl.patch +zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch diff --git a/queue-6.9/usb-storage-alauda-check-whether-the-media-is-initia.patch b/queue-6.9/usb-storage-alauda-check-whether-the-media-is-initia.patch new file mode 100644 index 00000000000..342538f7a63 --- /dev/null +++ b/queue-6.9/usb-storage-alauda-check-whether-the-media-is-initia.patch @@ -0,0 +1,61 @@ +From 46c4bb2d0307d80eeb748165b8cd052daa394765 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 26 May 2024 09:27:45 +0800 +Subject: usb-storage: alauda: Check whether the media is initialized + +From: Shichao Lai + +[ Upstream commit 16637fea001ab3c8df528a8995b3211906165a30 ] + +The member "uzonesize" of struct alauda_info will remain 0 +if alauda_init_media() fails, potentially causing divide errors +in alauda_read_data() and alauda_write_lba(). +- Add a member "media_initialized" to struct alauda_info. +- Change a condition in alauda_check_media() to ensure the + first initialization. +- Add an error check for the return value of alauda_init_media(). + +Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support") +Reported-by: xingwei lee +Reported-by: yue sun +Reviewed-by: Alan Stern +Signed-off-by: Shichao Lai +Link: https://lore.kernel.org/r/20240526012745.2852061-1-shichaorai@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/storage/alauda.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c +index 115f05a6201a1..40d34cc28344a 100644 +--- a/drivers/usb/storage/alauda.c ++++ b/drivers/usb/storage/alauda.c +@@ -105,6 +105,8 @@ struct alauda_info { + unsigned char sense_key; + unsigned long sense_asc; /* additional sense code */ + unsigned long sense_ascq; /* additional sense code qualifier */ ++ ++ bool media_initialized; + }; + + #define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) ) +@@ -476,11 +478,12 @@ static int alauda_check_media(struct us_data *us) + } + + /* Check for media change */ +- if (status[0] & 0x08) { ++ if (status[0] & 0x08 || !info->media_initialized) { + usb_stor_dbg(us, "Media change detected\n"); + alauda_free_maps(&MEDIA_INFO(us)); +- alauda_init_media(us); +- ++ rc = alauda_init_media(us); ++ if (rc == USB_STOR_TRANSPORT_GOOD) ++ info->media_initialized = true; + info->sense_key = UNIT_ATTENTION; + info->sense_asc = 0x28; + info->sense_ascq = 0x00; +-- +2.43.0 + diff --git a/queue-6.9/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch b/queue-6.9/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch new file mode 100644 index 00000000000..a8f7b649e4a --- /dev/null +++ b/queue-6.9/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch @@ -0,0 +1,61 @@ +From 5fe15bf52cddfca7652cc589b3e50ffc2339a429 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 8 Jun 2024 14:06:16 +0200 +Subject: zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with + TIF_SIGPENDING + +From: Oleg Nesterov + +[ Upstream commit 7fea700e04bd3f424c2d836e98425782f97b494e ] + +kernel_wait4() doesn't sleep and returns -EINTR if there is no +eligible child and signal_pending() is true. + +That is why zap_pid_ns_processes() clears TIF_SIGPENDING but this is not +enough, it should also clear TIF_NOTIFY_SIGNAL to make signal_pending() +return false and avoid a busy-wait loop. + +Link: https://lkml.kernel.org/r/20240608120616.GB7947@redhat.com +Fixes: 12db8b690010 ("entry: Add support for TIF_NOTIFY_SIGNAL") +Signed-off-by: Oleg Nesterov +Reported-by: Rachel Menge +Closes: https://lore.kernel.org/all/1386cd49-36d0-4a5c-85e9-bc42056a5a38@linux.microsoft.com/ +Reviewed-by: Boqun Feng +Tested-by: Wei Fu +Reviewed-by: Jens Axboe +Cc: Allen Pais +Cc: Christian Brauner +Cc: Frederic Weisbecker +Cc: Joel Fernandes (Google) +Cc: Joel Granados +Cc: Josh Triplett +Cc: Lai Jiangshan +Cc: Mateusz Guzik +Cc: Mathieu Desnoyers +Cc: Mike Christie +Cc: Neeraj Upadhyay +Cc: Paul E. McKenney +Cc: Steven Rostedt (Google) +Cc: Zqiang +Cc: Thomas Gleixner +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +--- + kernel/pid_namespace.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c +index 7ade20e952321..415201ca0c7e4 100644 +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -218,6 +218,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) + */ + do { + clear_thread_flag(TIF_SIGPENDING); ++ clear_thread_flag(TIF_NOTIFY_SIGNAL); + rc = kernel_wait4(-1, NULL, __WALL, NULL); + } while (rc != -ECHILD); + +-- +2.43.0 + -- 2.47.3