From: Greg Kroah-Hartman Date: Fri, 16 Sep 2022 09:43:38 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.9.329~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4e53d241dc00e5e0e4c6f467765042c7ee5819c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch net-dp83822-disable-rx-error-interrupt.patch tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch --- diff --git a/queue-4.19/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch b/queue-4.19/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch new file mode 100644 index 00000000000..e5f25229305 --- /dev/null +++ b/queue-4.19/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch @@ -0,0 +1,49 @@ +From jannh@google.com Fri Sep 16 11:29:18 2022 +From: Jann Horn +Date: Thu, 15 Sep 2022 16:25:19 +0200 +Subject: mm: Fix TLB flush for not-first PFNMAP mappings in unmap_region() +To: stable@vger.kernel.org, Greg Kroah-Hartman +Cc: Hugh Dickins , Peter Zijlstra +Message-ID: <20220915142519.2941949-1-jannh@google.com> + +From: Jann Horn + +This is a stable-specific patch. +I botched the stable-specific rewrite of +commit b67fbebd4cf98 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas"): +As Hugh pointed out, unmap_region() actually operates on a list of VMAs, +and the variable "vma" merely points to the first VMA in that list. +So if we want to check whether any of the VMAs we're operating on is +PFNMAP or MIXEDMAP, we have to iterate through the list and check each VMA. + +Signed-off-by: Jann Horn +Signed-off-by: Greg Kroah-Hartman +--- + mm/mmap.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/mm/mmap.c ++++ b/mm/mmap.c +@@ -2567,6 +2567,7 @@ static void unmap_region(struct mm_struc + { + struct vm_area_struct *next = prev ? prev->vm_next : mm->mmap; + struct mmu_gather tlb; ++ struct vm_area_struct *cur_vma; + + lru_add_drain(); + tlb_gather_mmu(&tlb, mm, start, end); +@@ -2581,8 +2582,12 @@ static void unmap_region(struct mm_struc + * concurrent flush in this region has to be coming through the rmap, + * and we synchronize against that using the rmap lock. + */ +- if ((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0) +- tlb_flush_mmu(&tlb); ++ for (cur_vma = vma; cur_vma; cur_vma = cur_vma->vm_next) { ++ if ((cur_vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0) { ++ tlb_flush_mmu(&tlb); ++ break; ++ } ++ } + + free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS, + next ? next->vm_start : USER_PGTABLES_CEILING); diff --git a/queue-4.19/net-dp83822-disable-rx-error-interrupt.patch b/queue-4.19/net-dp83822-disable-rx-error-interrupt.patch new file mode 100644 index 00000000000..613d06a4d4e --- /dev/null +++ b/queue-4.19/net-dp83822-disable-rx-error-interrupt.patch @@ -0,0 +1,38 @@ +From 0e597e2affb90d6ea48df6890d882924acf71e19 Mon Sep 17 00:00:00 2001 +From: Enguerrand de Ribaucourt +Date: Thu, 23 Jun 2022 15:46:45 +0200 +Subject: net: dp83822: disable rx error interrupt + +From: Enguerrand de Ribaucourt + +commit 0e597e2affb90d6ea48df6890d882924acf71e19 upstream. + +Some RX errors, notably when disconnecting the cable, increase the RCSR +register. Once half full (0x7fff), an interrupt flood is generated. I +measured ~3k/s interrupts even after the RX errors transfer was +stopped. + +Since we don't read and clear the RCSR register, we should disable this +interrupt. + +Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") +Signed-off-by: Enguerrand de Ribaucourt +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/phy/dp83822.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/phy/dp83822.c ++++ b/drivers/net/phy/dp83822.c +@@ -203,8 +203,7 @@ static int dp83822_config_intr(struct ph + if (misr_status < 0) + return misr_status; + +- misr_status |= (DP83822_RX_ERR_HF_INT_EN | +- DP83822_ANEG_COMPLETE_INT_EN | ++ misr_status |= (DP83822_ANEG_COMPLETE_INT_EN | + DP83822_DUP_MODE_CHANGE_INT_EN | + DP83822_SPEED_CHANGED_INT_EN | + DP83822_LINK_STAT_INT_EN | diff --git a/queue-4.19/series b/queue-4.19/series index 02eeb9d7500..660f0bcbf2f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -6,3 +6,6 @@ input-iforce-add-support-for-boeder-force-feedback-w.patch perf-arm_pmu_platform-fix-tests-for-platform_get_irq.patch platform-x86-acer-wmi-acer-aspire-one-aod270-packard.patch usb-storage-add-asus-0x0b05-0x1932-to-ignore_uas.patch +mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch +net-dp83822-disable-rx-error-interrupt.patch +tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch diff --git a/queue-4.19/tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch b/queue-4.19/tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch new file mode 100644 index 00000000000..a58e5ced2af --- /dev/null +++ b/queue-4.19/tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch @@ -0,0 +1,138 @@ +From 47311db8e8f33011d90dee76b39c8886120cdda4 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Fri, 26 Aug 2022 17:44:17 -0700 +Subject: tracefs: Only clobber mode/uid/gid on remount if asked + +From: Brian Norris + +commit 47311db8e8f33011d90dee76b39c8886120cdda4 upstream. + +Users may have explicitly configured their tracefs permissions; we +shouldn't overwrite those just because a second mount appeared. + +Only clobber if the options were provided at mount time. + +Note: the previous behavior was especially surprising in the presence of +automounted /sys/kernel/debug/tracing/. + +Existing behavior: + + ## Pre-existing status: tracefs is 0755. + # stat -c '%A' /sys/kernel/tracing/ + drwxr-xr-x + + ## (Re)trigger the automount. + # umount /sys/kernel/debug/tracing + # stat -c '%A' /sys/kernel/debug/tracing/. + drwx------ + + ## Unexpected: the automount changed mode for other mount instances. + # stat -c '%A' /sys/kernel/tracing/ + drwx------ + +New behavior (after this change): + + ## Pre-existing status: tracefs is 0755. + # stat -c '%A' /sys/kernel/tracing/ + drwxr-xr-x + + ## (Re)trigger the automount. + # umount /sys/kernel/debug/tracing + # stat -c '%A' /sys/kernel/debug/tracing/. + drwxr-xr-x + + ## Expected: the automount does not change other mount instances. + # stat -c '%A' /sys/kernel/tracing/ + drwxr-xr-x + +Link: https://lkml.kernel.org/r/20220826174353.2.Iab6e5ea57963d6deca5311b27fb7226790d44406@changeid + +Cc: stable@vger.kernel.org +Fixes: 4282d60689d4f ("tracefs: Add new tracefs file system") +Signed-off-by: Brian Norris +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + fs/tracefs/inode.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/fs/tracefs/inode.c ++++ b/fs/tracefs/inode.c +@@ -142,6 +142,8 @@ struct tracefs_mount_opts { + kuid_t uid; + kgid_t gid; + umode_t mode; ++ /* Opt_* bitfield. */ ++ unsigned int opts; + }; + + enum { +@@ -242,6 +244,7 @@ static int tracefs_parse_options(char *d + kgid_t gid; + char *p; + ++ opts->opts = 0; + opts->mode = TRACEFS_DEFAULT_MODE; + + while ((p = strsep(&data, ",")) != NULL) { +@@ -276,24 +279,36 @@ static int tracefs_parse_options(char *d + * but traditionally tracefs has ignored all mount options + */ + } ++ ++ opts->opts |= BIT(token); + } + + return 0; + } + +-static int tracefs_apply_options(struct super_block *sb) ++static int tracefs_apply_options(struct super_block *sb, bool remount) + { + struct tracefs_fs_info *fsi = sb->s_fs_info; + struct inode *inode = sb->s_root->d_inode; + struct tracefs_mount_opts *opts = &fsi->mount_opts; + +- inode->i_mode &= ~S_IALLUGO; +- inode->i_mode |= opts->mode; ++ /* ++ * On remount, only reset mode/uid/gid if they were provided as mount ++ * options. ++ */ ++ ++ if (!remount || opts->opts & BIT(Opt_mode)) { ++ inode->i_mode &= ~S_IALLUGO; ++ inode->i_mode |= opts->mode; ++ } + +- inode->i_uid = opts->uid; ++ if (!remount || opts->opts & BIT(Opt_uid)) ++ inode->i_uid = opts->uid; + +- /* Set all the group ids to the mount option */ +- set_gid(sb->s_root, opts->gid); ++ if (!remount || opts->opts & BIT(Opt_gid)) { ++ /* Set all the group ids to the mount option */ ++ set_gid(sb->s_root, opts->gid); ++ } + + return 0; + } +@@ -308,7 +323,7 @@ static int tracefs_remount(struct super_ + if (err) + goto fail; + +- tracefs_apply_options(sb); ++ tracefs_apply_options(sb, true); + + fail: + return err; +@@ -360,7 +375,7 @@ static int trace_fill_super(struct super + + sb->s_op = &tracefs_super_operations; + +- tracefs_apply_options(sb); ++ tracefs_apply_options(sb, false); + + return 0; +