From 4b4b7f4531a8de646c81fe55fca36382a66a79e4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 27 Oct 2022 17:55:46 +0200 Subject: [PATCH] 4.19-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-4.19/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 queue-4.19/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch diff --git a/queue-4.19/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch b/queue-4.19/mm-proc-pid-smaps_rollup-fix-no-vma-s-null-deref.patch new file mode 100644 index 00000000000..7113becc20a --- /dev/null +++ b/queue-4.19/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 +@@ -843,7 +843,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-4.19/series b/queue-4.19/series index 661bf1cea1f..3546f51ac82 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -22,3 +22,4 @@ media-v4l2-mem2mem-apply-dst_queue_off_base-on-mmap-buffers-across-ioctls.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