From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BFE6C433FE for ; Tue, 4 Oct 2022 18:46:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A10B6B0071; Tue, 4 Oct 2022 14:46:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9509D6B0073; Tue, 4 Oct 2022 14:46:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 818F96B0074; Tue, 4 Oct 2022 14:46:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7248C6B0071 for ; Tue, 4 Oct 2022 14:46:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2A3F4A7FBC for ; Tue, 4 Oct 2022 18:46:25 +0000 (UTC) X-FDA: 79984147530.07.C601B54 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id B2BA2180013 for ; Tue, 4 Oct 2022 18:46:24 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A4D03614CE; Tue, 4 Oct 2022 18:46:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDB27C433C1; Tue, 4 Oct 2022 18:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1664909183; bh=GecLqW4Hs2snJC3yF9KcRMx95IwFQlNqrAwVphvfFhc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xF3ghwHRQJqR6Zh3taLN6d/wH6X9IZf9yQx5gux6OHXvkzwZ2o//WphkWLiYOOmY6 Wk0VGVljcTCWJCZJ9NEjgCbqx/KoTNmARJqSuX/Z+Rhi/g5G4KjQHD3sTwVTaMEwU/ J6YYIXh2rKyeCqrdUI5ovDIU8TONyLhNStAUPnGI= Date: Tue, 4 Oct 2022 11:46:21 -0700 From: Andrew Morton To: FirstName LastName Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Dobriyan , Vlastimil Babka , Jann Horn , linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [PATCH] mm: /proc/pid/smaps_rollup: fix no vma's null-deref Message-Id: <20221004114621.7b539d2c3618b25037c4f2d0@linux-foundation.org> In-Reply-To: <20221003224531.1930646-1-sethjenkins@google.com> References: <20221003224531.1930646-1-sethjenkins@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664909184; a=rsa-sha256; cv=none; b=bzdp9xkP2Ot9XKTqyYI+FQAxvhZu/WlL1v0iJ3VNn8elOm2Gr8l4kVlgUc3ZCcUesOVBv3 +muNgpQcNtnvNNblRSBWtnJA2mj3Fc1y9QNSWl81jdmtkcirLpbT3cis0aZepiivHLWIKJ iwRjZsmQPSHt/jYmSu2UKPw5fhEyyv4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=xF3ghwHR; dmarc=none; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664909184; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jcyxu51XbZoy/nMuqoA9Ph9K9NBTedFu14E0a5IBB7Y=; b=AWJCdk73jOq2HoNW0JEV84MTqZfShLVusB4sH4iubUKx6DP2PE5kM5m8aT50ngJs+mOp1D G8Mlmq22q+dCdc5H5P2RkAOHWHAsD9GAcu6k9SOfWnCEVKMqNUeohIYfP/dQ8is/jssXwM l7EzvCa9qmTNoC1ygnw6FACfz4uyHpY= X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=xF3ghwHR; dmarc=none; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: 78oumqrmcwzwsud5cktcj4kaajqf5rg9 X-Rspamd-Queue-Id: B2BA2180013 X-Rspamd-Server: rspam09 X-HE-Tag: 1664909184-819407 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 3 Oct 2022 18:45:31 -0400 FirstName LastName wrote: > 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. > > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -969,7 +969,7 @@ static int show_smaps_rollup(struct seq_file *m, void *v) > vma = vma->vm_next; > } > > - 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"); The current mm tree is very different here. In fact the bug might not exist any more. Please take a look at the mm-stable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm? If no fixes are needed in mm-stable then I guess the process is to propose this patch to the stable tree maintainers.