Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1035179rwb; Tue, 4 Oct 2022 14:30:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7F571Mx1zq8n0AdNSh36R6KtcdQXLMWLvcV2GXU4dgAbm4tNNRRG5RVynKv2Y0KSOSsAF9 X-Received: by 2002:a05:6a00:114c:b0:528:2c7a:630e with SMTP id b12-20020a056a00114c00b005282c7a630emr28982938pfm.86.1664918999776; Tue, 04 Oct 2022 14:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664918999; cv=none; d=google.com; s=arc-20160816; b=fj71+JYj+NoP4CnAPCCoyloXJ+EB/l7svRepaMajM0JrxCYFZynFDIoNI+5SAwGGvz NWsXH25uoFg91m9h/ugjO3sUntIQQS0g1ZzkGlj7mTahfwSEhZ4Xlr13x64BeDKIYMVR sNgptDipcbsnjgDKoOSdKl4TBdvcgAP7ZM4/QfXBwAbKkNhDjqd4bFWoU1DU9eSj3YvF 6TAv6w1qNz21kv4wTm+a2EFXzHAjNPXmHerrs0lkhlPD3wh5f/HXArhpBw4eMlHW0Oll lFEZkKG4OaxLK6jWTImkUfXmWfCJouO5k4OufM6NybD77bE6Enw9ubmS0SaGMO/48flD Ys6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PGXp3VOaj51mo3NAOboUEy2QOQRbII2zrb0XhYBKtGM=; b=IRKmZQ7nWyc3oL+IoKUEQszKJOaKMHeC4Th7DKk49pw014NkasAMNAHHd8SxbxO0J0 J2AP+AcsJXIWZOTaeyGp7aFi4IIj5hqo41/Um2u76/V2E7i2vMQIMD2+iysc3TKWFmUa 9tGvIst3QucTARrWEW3Wvw7DzN3FNdV7VpuxPbbbE6GfJ/rzIPQaHR+4AEoLK0Zav2sl b2gzqt+6WKelAmgvWGuJ9L3BMQhEHNtNeVxe62O3FwWM1iBxmincR3nIm109DpsXj44c 34mUhgn2lVJbEibm+QPCK0Xy7Fh99hBQ2xLXWYwhGqYd2J+nyZ+m1+bYrfeNKmhnW2+S 3Heg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ei9P+Bd8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17-20020a170902d15100b0017f775beac8si531057plt.601.2022.10.04.14.29.41; Tue, 04 Oct 2022 14:29:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ei9P+Bd8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbiJDVGN (ORCPT + 99 others); Tue, 4 Oct 2022 17:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbiJDVGL (ORCPT ); Tue, 4 Oct 2022 17:06:11 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 276E96AE9D for ; Tue, 4 Oct 2022 14:06:10 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id bj12so31460215ejb.13 for ; Tue, 04 Oct 2022 14:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=PGXp3VOaj51mo3NAOboUEy2QOQRbII2zrb0XhYBKtGM=; b=ei9P+Bd8IeYaUbJs/c5FUcgm+e2dtUe8rcWZVo37eSWgUxP4UD6QIGM56JRbUsdKAq 4ChHOm92aseqM7vhWHDHYMlhdU4mpHqDSVbRYUQtjYgUHVj3Ewp87aHLGcd92ibTqxNU 2IGstbKW8X5ojiiNgUj0SQuMnL9V9JtF3auD/RllL0djegSirzfVdKiYefVkgtWql0Ui FPpD9GZc3H9ebBi3c7N2NFImWUYv8+LyW95cg8EwHPK4pjqhyJKcUIGMqHjkSE/9cOIM FjV23SIMC2JLakD2F+Htd1704Wd9H3+8iaB5WOQW5T8vEPL0q7CVDVkVUWIg8kMr3WjP Mnmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=PGXp3VOaj51mo3NAOboUEy2QOQRbII2zrb0XhYBKtGM=; b=kjSl2UE5zHwswt5T5L9wj4ard48NoD1vcvjV4Sb/N2Mo+5fqtF6QfLefY2Dl+4FHwi faJtnm9NzSixsA4Gn0k6ER/gOmRlNLAN1dhcDauO0HaPGVmDdFy25wqYtICAs28G/rfv UmF8Ohk08abRTZL7whihBRXePZBitFWjC759U5dLYcC4zhXgc/qPEBUQ1jIp534/rsIx 854CzR8BBVES7OQR7KM9T0PpoOOK4uV9t5meAbwOIIG/jlh+GxJqf4OJWD3DI8YUDCPN zmIRWTKU5BxI+WdBFWJuq0+NUFXTKNhgVwM0hhzRZkhTHGfnKqwoL9bmZCzx1/0HhSTZ DrsQ== X-Gm-Message-State: ACrzQf286av+bpZ1FmFhq62ltPhjjeYEJ4Kp11paLsixDakZd/Y7Qojv drS9250UuSuQrSIghh+W3w4XbfbMzLv9RiGquOGKRg== X-Received: by 2002:a17:907:6d28:b0:782:32ad:7b64 with SMTP id sa40-20020a1709076d2800b0078232ad7b64mr22349233ejc.23.1664917568615; Tue, 04 Oct 2022 14:06:08 -0700 (PDT) MIME-Version: 1.0 References: <20221003224531.1930646-1-sethjenkins@google.com> <20221004114621.7b539d2c3618b25037c4f2d0@linux-foundation.org> In-Reply-To: <20221004114621.7b539d2c3618b25037c4f2d0@linux-foundation.org> From: Seth Jenkins Date: Tue, 4 Oct 2022 17:05:57 -0400 Message-ID: Subject: Re: [PATCH] mm: /proc/pid/smaps_rollup: fix no vma's null-deref To: Andrew Morton 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I concur, mm-stable looks fine to me as well. Jann and I conversed today and the tentative decision since this isn't considered a high-priority security bug is to wait for maple tree to merge into Linus's branch before submitting this patch to stable. On Tue, Oct 4, 2022 at 2:46 PM Andrew Morton wrote: > > 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. >