From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1159AD23 for ; Thu, 27 Oct 2022 17:10:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49E9DC433C1; Thu, 27 Oct 2022 17:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666890621; bh=5nHD4EdobDTekB7OeRn72V2zL9cMbr3p5Z/BAnBioJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZACp127xSrZE+E4qNSSkcOLArWdxOfS2UuCWzK3oa/CdCmWokfFrwlbwcYDPHQql UfDf0kgJe10Vt9M+4PV9GS4U/7wZDLnPW544gbqppn1/aSKo//hWvgh/KPayZYA6zY o4SlPMI9gptlycBENIbxvvAX6TsCJ82bRsjkdxes= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Seth Jenkins , Alexey Dobriyan Subject: [PATCH 5.4 53/53] mm: /proc/pid/smaps_rollup: fix no vmas null-deref Date: Thu, 27 Oct 2022 18:56:41 +0200 Message-Id: <20221027165051.926794456@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027165049.817124510@linuxfoundation.org> References: <20221027165049.817124510@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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");