From e992f8f9f2a97685113d371b10a7812c987ea59c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 27 Oct 2022 17:56:25 +0200 Subject: [PATCH] 5.4-stable patches added patches: mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch --- ...smaps_rollup-fix-no-vma-s-null-deref.patch | 34 +++++++++++++++++++ queue-5.4/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 queue-5.4/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch diff --git a/queue-5.4/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch b/queue-5.4/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch new file mode 100644 index 00000000000..4588c2f8975 --- /dev/null +++ b/queue-5.4/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch @@ -0,0 +1,34 @@ +From sethjenkins@google.com Thu Oct 27 17:53:55 2022 +From: Seth Jenkins +Date: Thu, 27 Oct 2022 11:36:52 -0400 +Subject: mm: /proc/pid/smaps_rollup: fix no vma's null-deref +To: stable@vger.kernel.org +Cc: Andrew Morton , Seth Jenkins , Alexey Dobriyan +Message-ID: <20221027153652.899495-1-sethjenkins@google.com> + +From: Seth Jenkins + +Commit 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value +seq_file") introduced a null-deref if there are no vma's in the task in +show_smaps_rollup. + +Fixes: 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") +Signed-off-by: Seth Jenkins +Reviewed-by: Alexey Dobriyan +Tested-by: Alexey Dobriyan +Signed-off-by: Greg Kroah-Hartman +--- + fs/proc/task_mmu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/proc/task_mmu.c ++++ b/fs/proc/task_mmu.c +@@ -884,7 +884,7 @@ static int show_smaps_rollup(struct seq_ + last_vma_end = vma->vm_end; + } + +- show_vma_header_prefix(m, priv->mm->mmap->vm_start, ++ show_vma_header_prefix(m, priv->mm->mmap ? priv->mm->mmap->vm_start : 0, + last_vma_end, 0, 0, 0, 0); + seq_pad(m, ' '); + seq_puts(m, "[rollup]\n"); diff --git a/queue-5.4/series b/queue-5.4/series index 8b399ea7f9b..fce3ee37457 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -50,3 +50,4 @@ riscv-topology-fix-default-topology-reporting.patch acpi-video-force-backlight-native-for-more-tongfang-devices.patch makefile.debug-re-enable-debug-info-for-.s-files.patch hv_netvsc-fix-race-between-vf-offering-and-vf-association-message-from-host.patch +mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch -- 2.47.3