From 0314553d247ab040e4094ec682e37e938a525f83 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 May 2022 14:44:06 +0200 Subject: [PATCH] drop nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch It was a duplicate and backported incorrectly :( --- ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-4.14/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-4.19/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-4.9/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-5.10/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-5.15/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-5.17/series | 1 - ...sleep-in-atomic-bug-when-firmware-do.patch | 70 ------------------- queue-5.4/series | 1 - 14 files changed, 497 deletions(-) delete mode 100644 queue-4.14/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-4.19/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-4.9/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-5.15/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-5.17/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch delete mode 100644 queue-5.4/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch diff --git a/queue-4.14/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-4.14/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index 8936cfb6bcf..00000000000 --- a/queue-4.14/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 9e3510559a02578231d6e72715848b45139ce331 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 0320ae7560ad..c7f28e9e18c4 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -563,7 +563,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -583,7 +583,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-4.14/series b/queue-4.14/series index ab87c0632eb..d73c7d813ff 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -72,7 +72,6 @@ btrfs-always-log-symlinks-in-full-mode.patch net-igmp-respect-rcu-rules-in-ip_mc_source-and-ip_mc_msfilter.patch hwmon-adt7470-fix-warning-on-module-removal.patch-27384 kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch net-ipv6-ensure-we-call-ipv6_mc_down-at-most-once.patch dm-fix-mempool-null-pointer-race-when-completing-io.patch dm-interlock-pending-dm_io-and-dm_wait_for_bios_completion.patch diff --git a/queue-4.19/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-4.19/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index 3a8d60fc489..00000000000 --- a/queue-4.19/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 5fac379a2acd53149359847192889908c132cc46 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 39fb01ee9222..c88a32b8d15e 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -553,7 +553,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -573,7 +573,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-4.19/series b/queue-4.19/series index 2207c56824b..b9b0ac9c813 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -80,7 +80,6 @@ btrfs-always-log-symlinks-in-full-mode.patch net-igmp-respect-rcu-rules-in-ip_mc_source-and-ip_mc_msfilter.patch hwmon-adt7470-fix-warning-on-module-removal.patch-23920 kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch mm-fix-unexpected-zeroed-page-mapping-with-zram-swap.patch tcp-make-sure-treq-af_specific-is-initialized.patch dm-fix-mempool-null-pointer-race-when-completing-io.patch diff --git a/queue-4.9/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-4.9/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index 2b27fb1b42a..00000000000 --- a/queue-4.9/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 997abf8969dd31ed3aa7bfa962e36790cafa6e82 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 9750997643bb..420023025e5d 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -562,7 +562,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -582,7 +582,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-4.9/series b/queue-4.9/series index 2d2e93e9d49..5f5a84cd6dc 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -61,7 +61,6 @@ btrfs-always-log-symlinks-in-full-mode.patch net-igmp-respect-rcu-rules-in-ip_mc_source-and-ip_mc_msfilter.patch hwmon-adt7470-fix-warning-on-module-removal.patch-27037 kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch net-sched-prevent-uaf-on-tc_ctl_tfilter-when-temporarily-dropping-rtnl_lock.patch net-ipv6-ensure-we-call-ipv6_mc_down-at-most-once.patch dm-fix-mempool-null-pointer-race-when-completing-io.patch diff --git a/queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index f81aa694fdd..00000000000 --- a/queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 75cf9d713983e059a99996bad911f3a495a32a4f Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index b8939ebaa6d3..c86e4b95f61b 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -534,7 +534,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -554,7 +554,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-5.10/series b/queue-5.10/series index b564b6aca35..53795b4d0c9 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -58,7 +58,6 @@ net-igmp-respect-rcu-rules-in-ip_mc_source-and-ip_mc_msfilter.patch hwmon-adt7470-fix-warning-on-module-removal.patch-3384 kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch net-mlx5-fix-slab-out-of-bounds-while-reading-resour.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch x86-kvm-preserve-bsp-msr_kvm_poll_control-across-sus.patch kvm-x86-do-not-change-icr-on-write-to-apic_self_ipi.patch kvm-x86-mmu-avoid-null-pointer-dereference-on-page-f.patch diff --git a/queue-5.15/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-5.15/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index f5dbc1bb2f3..00000000000 --- a/queue-5.15/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 27a214b70554e2dea2d36d8b6344d681049d826e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index a207f0b8137b..60fc85781373 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -534,7 +534,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -554,7 +554,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 9df23588d35..e49fdc6f2e5 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -91,7 +91,6 @@ net-mlx5e-lag-fix-use-after-free-in-fib-event-handle.patch net-mlx5e-lag-fix-fib_info-pointer-assignment.patch net-mlx5e-lag-don-t-skip-fib-events-on-current-dst.patch iommu-dart-add-missing-module-owner-to-ops-structure.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch kvm-selftests-do-not-use-bitfields-larger-than-32-bi.patch kvm-selftests-silence-compiler-warning-in-the-kvm_pa.patch x86-kvm-preserve-bsp-msr_kvm_poll_control-across-sus.patch diff --git a/queue-5.17/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-5.17/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index 31aa2d8f897..00000000000 --- a/queue-5.17/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 3704254200cd569167a7c4f81923cb6be71901ef Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 7c62417ccfd7..5c429e25bcf7 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -534,7 +534,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -554,7 +554,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-5.17/series b/queue-5.17/series index 3345d05e524..82cc9c46988 100644 --- a/queue-5.17/series +++ b/queue-5.17/series @@ -108,7 +108,6 @@ net-rds-acquire-refcount-on-tcp-sockets.patch kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch fbdev-make-fb_release-return-enodev-if-fbdev-was-unr.patch iommu-dart-add-missing-module-owner-to-ops-structure.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch kvm-sev-mark-nested-locking-of-vcpu-lock.patch kvm-vmx-exit-to-userspace-if-vcpu-has-injected-excep.patch kvm-selftests-do-not-use-bitfields-larger-than-32-bi.patch diff --git a/queue-5.4/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch b/queue-5.4/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch deleted file mode 100644 index 96128641fe6..00000000000 --- a/queue-5.4/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch +++ /dev/null @@ -1,70 +0,0 @@ -From eb97b9f8bfb9bed63c50821b17f83e052dfb0a86 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 4 May 2022 13:58:47 +0800 -Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout - -From: Duoming Zhou - -[ Upstream commit 4071bf121d59944d5cd2238de0642f3d7995a997 ] - -There are sleep in atomic bug that could cause kernel panic during -firmware download process. The root cause is that nlmsg_new with -GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer -handler. The call trace is shown below: - -BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 -Call Trace: -kmem_cache_alloc_node -__alloc_skb -nfc_genl_fw_download_done -call_timer_fn -__run_timers.part.0 -run_timer_softirq -__do_softirq -... - -The nlmsg_new with GFP_KERNEL parameter may sleep during memory -allocation process, and the timer handler is run as the result of -a "software interrupt" that should not call any other function -that could sleep. - -This patch changes allocation mode of netlink message from GFP_KERNEL -to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC -flag makes memory allocation operation could be used in atomic context. - -Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") -Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") -Signed-off-by: Duoming Zhou -Reviewed-by: Krzysztof Kozlowski -Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - net/nfc/netlink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 9e94f732e717..a5d8f87c3763 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -542,7 +542,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - struct sk_buff *msg; - void *hdr; - -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); - if (!msg) - return -ENOMEM; - -@@ -562,7 +562,7 @@ int nfc_genl_se_connectivity(struct nfc_dev *dev, u8 se_idx) - - genlmsg_end(msg, hdr); - -- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); -+ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); - - return 0; - --- -2.35.1 - diff --git a/queue-5.4/series b/queue-5.4/series index 36a7ed79847..28e71ded7cc 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -35,7 +35,6 @@ drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch hwmon-adt7470-fix-warning-on-module-removal.patch-15216 nfsv4-don-t-invalidate-inode-attributes-on-delegatio.patch kvm-x86-cpuid-only-provide-cpuid-leaf-0xa-if-host-ha.patch -nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-do.patch x86-kvm-preserve-bsp-msr_kvm_poll_control-across-sus.patch kvm-lapic-enable-timer-posted-interrupt-only-when-mw.patch net-ipv6-ensure-we-call-ipv6_mc_down-at-most-once.patch -- 2.47.3