From 007dd6daa364520147a4ddea445fde2bc75a8909 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Fri, 8 Apr 2022 09:10:56 -0500 Subject: kernel-5.17.2-0 * Fri Apr 08 2022 Justin M. Forbes [5.17.2-0] - Move the patch to the redhat directory so it doesn't end up as an applied patch (Justin M. Forbes) - Config updates for 5.17.2 (Justin M. Forbes) - Fedora: arm: Updates for QCom devices (Peter Robinson) - Fedora arm and generic updates for 5.17 (Peter Robinson) - enable COMMON_CLK_SI5341 for Xilinx ZYNQ-MP (Peter Robinson) - Update Fix 'mem_section' will never be NULL gcc 12 warning to V4 (Justin M. Forbes) - NFSv4.1 provide mount option to toggle trunking discovery (Olga Kornievskaia) - Add the Revert patch so that it can be applied when building dist-git for F34 and F35 (Justin M. Forbes) - redhat/configs/process_configs.sh: Avoid race with find (Prarit Bhargava) - redhat/configs/process_configs.sh: Remove CONTINUEONERROR (Prarit Bhargava) - redhat/configs/process_configs.sh: Fix race with tools generation (Prarit Bhargava) - Bluetooth: hci_core: Rate limit the logging of invalid SCO handle (Luiz Augusto von Dentz) - Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len (Luiz Augusto von Dentz) - Update mm/sparsemem: Fix 'mem_section' will never be NULL gcc 12 (Justin M. Forbes) - net: bcmgenet: Use stronger register read/writes to assure ordering (Jeremy Linton) - We actually needed the previous patch from os-build (Justin M. Forbes) - redhat: Fix release tagging (Prarit Bhargava) - Fix up changelog generation for stable releases (Justin M. Forbes) - Remove i686 configs and filters (Justin M. Forbes) - redhat/self-test: Fix shellcheck test (Prarit Bhargava) - redhat/configs: Set CONFIG_X86_AMD_PSTATE built-in on Fedora (Prarit Bhargava) Resolves: rhbz# Signed-off-by: Justin M. Forbes --- patch-5.17-redhat.patch | 164 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 116 insertions(+), 48 deletions(-) (limited to 'patch-5.17-redhat.patch') diff --git a/patch-5.17-redhat.patch b/patch-5.17-redhat.patch index c7eaa8cc0..05acb8d59 100644 --- a/patch-5.17-redhat.patch +++ b/patch-5.17-redhat.patch @@ -30,26 +30,30 @@ drivers/pci/msi/msi.c | 12 +- drivers/pci/quirks.c | 24 ++++ drivers/usb/core/hub.c | 7 ++ + fs/nfs/client.c | 3 +- + fs/nfs/fs_context.c | 8 ++ include/linux/dma-mapping.h | 8 ++ include/linux/efi.h | 22 ++-- include/linux/lsm_hook_defs.h | 2 + include/linux/lsm_hooks.h | 6 + - include/linux/mmzone.h | 4 +- + include/linux/mmzone.h | 11 +- include/linux/module.h | 1 + + include/linux/nfs_fs_sb.h | 1 + include/linux/random.h | 7 ++ include/linux/rmi.h | 1 + include/linux/security.h | 5 + init/Kconfig | 2 +- - kernel/dma/swiotlb.c | 23 ++-- + kernel/dma/swiotlb.c | 12 +- kernel/module.c | 2 + kernel/module_signing.c | 9 +- + net/bluetooth/hci_core.c | 4 +- scripts/mod/modpost.c | 8 ++ scripts/tags.sh | 2 + security/integrity/platform_certs/load_uefi.c | 6 +- security/lockdown/Kconfig | 13 +++ security/lockdown/lockdown.c | 1 + security/security.c | 6 + - 51 files changed, 752 insertions(+), 214 deletions(-) + 55 files changed, 767 insertions(+), 211 deletions(-) diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst index 1887d92e8e92..17706dc91ec9 100644 @@ -101,7 +105,7 @@ index 000000000000..733a26bd887a + +endmenu diff --git a/Makefile b/Makefile -index 34f9f5a9457a..799d71b74ea9 100644 +index 06d852cad74f..408d95c9769e 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,10 @@ $(if $(filter __%, $(MAKECMDGOALS)), \ @@ -147,10 +151,10 @@ index 4c97cb40eebb..caf06cef3d2e 100644 The VM uses one page of physical memory for each page table. For systems with a lot of processes, this can use a lot of diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index c842878f8133..72949bfbe1af 100644 +index baa0e9bbe754..7adce1807baf 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -1109,7 +1109,7 @@ endchoice +@@ -1110,7 +1110,7 @@ endchoice config ARM64_FORCE_52BIT bool "Force 52-bit virtual addresses for userspace" @@ -159,7 +163,7 @@ index c842878f8133..72949bfbe1af 100644 help For systems with 52-bit userspace VAs enabled, the kernel will attempt to maintain compatibility with older software by providing 48-bit VAs -@@ -1348,6 +1348,7 @@ config XEN +@@ -1349,6 +1349,7 @@ config XEN config FORCE_MAX_ZONEORDER int default "14" if ARM64_64K_PAGES @@ -359,7 +363,7 @@ index fea082b25fe4..50a9d040bed1 100644 MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Random Number Generator"); diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c -index 0edc1ed47673..782e2f399af2 100644 +index 6aef1ee5e1bd..8f146b1b4972 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c @@ -96,6 +96,14 @@ static int apei_hest_parse(apei_hest_func_t func, void *data) @@ -915,7 +919,7 @@ index 000000000000..de0a3714a5d4 + } +} diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c -index 00279e8c2775..545424e4a066 100644 +index b00de57cc957..c613b531b281 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -744,6 +744,15 @@ static bool intel_psr2_sel_fetch_config_valid(struct intel_dp *intel_dp, @@ -1318,7 +1322,7 @@ index 107dcf5938d6..225a9797e39d 100644 * Changes the default domain of an iommu group that has *only* one device * diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c -index fd4720d37cc0..c31bc05ec139 100644 +index 6215d50ed3e7..10f1629e0940 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -244,6 +244,9 @@ static void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl) @@ -1385,7 +1389,7 @@ index fd4720d37cc0..c31bc05ec139 100644 } EXPORT_SYMBOL_GPL(nvme_complete_rq); diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c -index ff775235534c..94de4ecefe56 100644 +index a703f1f5fb64..d77c24333cb4 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -101,14 +101,10 @@ bool nvme_mpath_set_disk_name(struct nvme_ns *ns, char *disk_name, int *flags) @@ -1421,7 +1425,7 @@ index ff775235534c..94de4ecefe56 100644 spin_lock_irqsave(&ns->head->requeue_lock, flags); for (bio = req->bio; bio; bio = bio->bi_next) { -@@ -869,8 +875,7 @@ int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) +@@ -870,8 +876,7 @@ int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) int error = 0; /* check if multipath is enabled and we have the capability */ @@ -1432,10 +1436,10 @@ index ff775235534c..94de4ecefe56 100644 if (!ctrl->max_namespaces || diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h -index a162f6c6da6e..0606205d5dcc 100644 +index 730cc80d84ff..3a57441b3ff3 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h -@@ -770,6 +770,7 @@ void nvme_mpath_start_freeze(struct nvme_subsystem *subsys); +@@ -789,6 +789,7 @@ void nvme_mpath_start_freeze(struct nvme_subsystem *subsys); void nvme_mpath_default_iopolicy(struct nvme_subsystem *subsys); bool nvme_mpath_set_disk_name(struct nvme_ns *ns, char *disk_name, int *flags); void nvme_failover_req(struct request *req); @@ -1443,7 +1447,7 @@ index a162f6c6da6e..0606205d5dcc 100644 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head); void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id); -@@ -808,6 +809,9 @@ static inline bool nvme_mpath_set_disk_name(struct nvme_ns *ns, char *disk_name, +@@ -827,6 +828,9 @@ static inline bool nvme_mpath_set_disk_name(struct nvme_ns *ns, char *disk_name, static inline void nvme_failover_req(struct request *req) { } @@ -1484,10 +1488,10 @@ index 9037a7827eca..e5900638483b 100644 pcibios_free_irq(dev); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 65f7f6b0576c..27398de38c0c 100644 +index da829274fc66..bb6e79ec3d00 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -4272,6 +4272,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, +@@ -4284,6 +4284,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084, quirk_bridge_cavm_thrx2_pcie_root); @@ -1536,6 +1540,53 @@ index 47a1c8bddf86..e309d992e2ad 100644 /* Lock the device, then check to see if we were * disconnected while waiting for the lock to succeed. */ usb_lock_device(hdev); +diff --git a/fs/nfs/client.c b/fs/nfs/client.c +index d1f34229e11a..e828504cc396 100644 +--- a/fs/nfs/client.c ++++ b/fs/nfs/client.c +@@ -857,7 +857,8 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str + } + + if (clp->rpc_ops->discover_trunking != NULL && +- (server->caps & NFS_CAP_FS_LOCATIONS)) { ++ (server->caps & NFS_CAP_FS_LOCATIONS && ++ (server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) { + error = clp->rpc_ops->discover_trunking(server, mntfh); + if (error < 0) + return error; +diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c +index ea17fa1f31ec..e2d59bb5e6bb 100644 +--- a/fs/nfs/fs_context.c ++++ b/fs/nfs/fs_context.c +@@ -80,6 +80,7 @@ enum nfs_param { + Opt_source, + Opt_tcp, + Opt_timeo, ++ Opt_trunkdiscovery, + Opt_udp, + Opt_v, + Opt_vers, +@@ -180,6 +181,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = { + fsparam_string("source", Opt_source), + fsparam_flag ("tcp", Opt_tcp), + fsparam_u32 ("timeo", Opt_timeo), ++ fsparam_flag_no("trunkdiscovery", Opt_trunkdiscovery), + fsparam_flag ("udp", Opt_udp), + fsparam_flag ("v2", Opt_v), + fsparam_flag ("v3", Opt_v), +@@ -529,6 +531,12 @@ static int nfs_fs_context_parse_param(struct fs_context *fc, + else + ctx->flags &= ~NFS_MOUNT_NOCTO; + break; ++ case Opt_trunkdiscovery: ++ if (result.negated) ++ ctx->flags &= ~NFS_MOUNT_TRUNK_DISCOVERY; ++ else ++ ctx->flags |= NFS_MOUNT_TRUNK_DISCOVERY; ++ break; + case Opt_ac: + if (result.negated) + ctx->flags |= NFS_MOUNT_NOAC; diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index dca2b1355bb1..6150d11a607e 100644 --- a/include/linux/dma-mapping.h @@ -1624,10 +1675,10 @@ index ccd4d3f91c98..e64643e3e364 100644 enum efi_secureboot_mode efi_get_secureboot_mode(efi_get_variable_t *get_var) { diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h -index 819ec92dc2a8..b49986bfbeca 100644 +index db924fe379c9..1169d78af2de 100644 --- a/include/linux/lsm_hook_defs.h +++ b/include/linux/lsm_hook_defs.h -@@ -392,6 +392,8 @@ LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux) +@@ -394,6 +394,8 @@ LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux) #endif /* CONFIG_BPF_SYSCALL */ LSM_HOOK(int, 0, locked_down, enum lockdown_reason what) @@ -1637,10 +1688,10 @@ index 819ec92dc2a8..b49986bfbeca 100644 #ifdef CONFIG_PERF_EVENTS LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int type) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h -index 3bf5c658bc44..4701bc5ce2f5 100644 +index 419b5febc3ca..491323dfe4e0 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h -@@ -1544,6 +1544,12 @@ +@@ -1549,6 +1549,12 @@ * * @what: kernel feature being accessed * @@ -1654,22 +1705,30 @@ index 3bf5c658bc44..4701bc5ce2f5 100644 * * @perf_event_open: diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h -index aed44e9b5d89..08517376c765 100644 +index aed44e9b5d89..c7a0d500b396 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h -@@ -1390,11 +1390,9 @@ static inline unsigned long *section_to_usemap(struct mem_section *ms) +@@ -1389,13 +1389,16 @@ static inline unsigned long *section_to_usemap(struct mem_section *ms) + static inline struct mem_section *__nr_to_section(unsigned long nr) { ++ unsigned long root = SECTION_NR_TO_ROOT(nr); ++ ++ if (unlikely(root >= NR_SECTION_ROOTS)) ++ return NULL; ++ #ifdef CONFIG_SPARSEMEM_EXTREME - if (!mem_section) -+ if (!*mem_section || !mem_section[SECTION_NR_TO_ROOT(nr)]) ++ if (!mem_section || !mem_section[root]) return NULL; #endif - if (!mem_section[SECTION_NR_TO_ROOT(nr)]) - return NULL; - return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; +- return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; ++ return &mem_section[root][nr & SECTION_ROOT_MASK]; } extern size_t mem_section_usage_size(void); + diff --git a/include/linux/module.h b/include/linux/module.h index 1e135fd5c076..6ec4d001c1e2 100644 --- a/include/linux/module.h @@ -1682,6 +1741,18 @@ index 1e135fd5c076..6ec4d001c1e2 100644 struct kobject *holders_dir; /* Exported symbols */ +diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h +index ca0959e51e81..b0e3fd550122 100644 +--- a/include/linux/nfs_fs_sb.h ++++ b/include/linux/nfs_fs_sb.h +@@ -151,6 +151,7 @@ struct nfs_server { + #define NFS_MOUNT_SOFTREVAL 0x800000 + #define NFS_MOUNT_WRITE_EAGER 0x01000000 + #define NFS_MOUNT_WRITE_WAIT 0x02000000 ++#define NFS_MOUNT_TRUNK_DISCOVERY 0x04000000 + + unsigned int fattr_valid; /* Valid attributes */ + unsigned int caps; /* server capabilities */ diff --git a/include/linux/random.h b/include/linux/random.h index c45b2693e51f..4edfdb3e44a9 100644 --- a/include/linux/random.h @@ -1720,7 +1791,7 @@ index ab7eea01ab42..fff7c5f737fc 100644 int rmi_register_transport_device(struct rmi_transport_dev *xport); diff --git a/include/linux/security.h b/include/linux/security.h -index 6d72772182c8..fe3b072665fb 100644 +index 25b3ef71f495..d37a6c88c69f 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -471,6 +471,7 @@ int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen); @@ -1756,7 +1827,7 @@ index e9119bf54b1f..e3b57b4898fe 100644 default y help diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c -index 6db1c475ec82..bfc56cb21705 100644 +index 6c350555e5a1..bfc56cb21705 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -627,14 +627,10 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr, @@ -1778,24 +1849,6 @@ index 6db1c475ec82..bfc56cb21705 100644 return tlb_addr; } -@@ -701,13 +697,10 @@ void swiotlb_tbl_unmap_single(struct device *dev, phys_addr_t tlb_addr, - void swiotlb_sync_single_for_device(struct device *dev, phys_addr_t tlb_addr, - size_t size, enum dma_data_direction dir) - { -- /* -- * Unconditional bounce is necessary to avoid corruption on -- * sync_*_for_cpu or dma_ummap_* when the device didn't overwrite -- * the whole lengt of the bounce buffer. -- */ -- swiotlb_bounce(dev, tlb_addr, size, DMA_TO_DEVICE); -- BUG_ON(!valid_dma_direction(dir)); -+ if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) -+ swiotlb_bounce(dev, tlb_addr, size, DMA_TO_DEVICE); -+ else -+ BUG_ON(dir != DMA_FROM_DEVICE); - } - - void swiotlb_sync_single_for_cpu(struct device *dev, phys_addr_t tlb_addr, diff --git a/kernel/module.c b/kernel/module.c index 46a5c2ed1928..92c2306651ce 100644 --- a/kernel/module.c @@ -1837,8 +1890,23 @@ index 8723ae70ea1f..fb2d773498c2 100644 + } + return ret; } +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index 2882bc7d79d7..bc3a11ec0c27 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -3667,8 +3667,8 @@ static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb) + sco_recv_scodata(conn, skb); + return; + } else { +- bt_dev_err(hdev, "SCO packet for unknown connection handle %d", +- handle); ++ bt_dev_err_ratelimited(hdev, "SCO packet for unknown connection handle %d", ++ handle); + } + + kfree_skb(skb); diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c -index 6bfa33217914..92d936f34b27 100644 +index e04ae56931e2..da97e6a8ee0a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -21,6 +21,7 @@ @@ -1944,10 +2012,10 @@ index 87cbdc64d272..18555cf18da7 100644 static int __init lockdown_lsm_init(void) diff --git a/security/security.c b/security/security.c -index 22261d79f333..20336365f864 100644 +index b7cf5cbfdc67..3cde9062fcf6 100644 --- a/security/security.c +++ b/security/security.c -@@ -2603,6 +2603,12 @@ int security_locked_down(enum lockdown_reason what) +@@ -2623,6 +2623,12 @@ int security_locked_down(enum lockdown_reason what) } EXPORT_SYMBOL(security_locked_down); -- cgit