Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp545628imd; Fri, 26 Oct 2018 12:42:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5dRmsU+2uuuyoBgkjFYKEpchlkHv7MXEC9RO1H1P+qxKeM3MYJzJcf7OtzQ6U4Bhwyj2p6O X-Received: by 2002:a17:902:5a49:: with SMTP id f9-v6mr4852185plm.75.1540582973133; Fri, 26 Oct 2018 12:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540582973; cv=none; d=google.com; s=arc-20160816; b=clwEYr2kmC8bopYLozAd1nN6I88zyKvEIdpkyDGbcAY/bEVMIrE8wUInUO+eyr4acu 5Eyd4u9yIh6EUUGUy0wQkJtkbywPlI9D8eSfcsb5ecFUEwC1pnFk50F3sRvm/E4X4Tjj o4cJzvuSyXO3Qn93WZhFTthEhVusyAvkTA+CXaorpgXPe+CcUHC0RnOAW+AFP6AvRAix TiJSP8SJAu6zXicr9jh4qDToOsZ4h86/cV8GafIkfF8GJcUbsy1XPx/DWOHIMlCqQrpm gVx8oNF7eqKKecIEsaJipBZSU6NIBdOmh1FSTGEL3Q9o57fCZD7BWg77gPc7yHr9FlFl 6atA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=ng9i93fUhpkuixCmGenFW8bBzXhLYzEnmrhj4FKr//k=; b=nM2zMCFPyOVAiAep/5z9gk2xQ2WE2ZmA1MGhFGRhtIbwahRDA06XsGYLcrhmEJVYw4 9BgixLVgtJ0msvyVOdMl9DytOB8KMPAOUwlk0mq4PB7nD8kxa5uXZrokuenff89BUdq6 pF/kNFnvFh+AXkrUvSxVNjtsVzo4Zk3oKiVZXgEP+01tSo+TwXKk6vZoE/x9pMjfFXYe cMipDdjQxVXTmHfQ7NxR7+gG0uZD7mupHT41CR50XWqBgbLPmjtUsTQ2qRsR8AyJgwnh mIG6mGRt3cP1cR0yMfpDm2j8KMAQyQ9etn/93Pg6WQo7UGGVZcP6Q2eu+TATk3NjPz/1 3Yqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=btp8bTK6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23-v6si11840516pgh.581.2018.10.26.12.42.37; Fri, 26 Oct 2018 12:42:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=btp8bTK6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbeJ0EUf (ORCPT + 99 others); Sat, 27 Oct 2018 00:20:35 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:40977 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbeJ0EUf (ORCPT ); Sat, 27 Oct 2018 00:20:35 -0400 Received: by mail-yw1-f66.google.com with SMTP id c126-v6so923115ywd.8 for ; Fri, 26 Oct 2018 12:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ng9i93fUhpkuixCmGenFW8bBzXhLYzEnmrhj4FKr//k=; b=btp8bTK6A9mJx7cXhZFUuBNkEW3+sSDUtS4csU7ziyTzHXeZ73LnuiFvMY3JJST3fi gYWLcC8XKjCNwS0NDnOLhkrIZVKMvlhGA/jirRS2wFkMPKY2mDxh7w348fnd/SgmPHYd g7bG0NLUV7Do5vm9mapRoRLgtqYY6dm4Qc1jM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ng9i93fUhpkuixCmGenFW8bBzXhLYzEnmrhj4FKr//k=; b=Z8o/FN2ePmiPH9YGR5RPcn5w3SWPHEUrsY4EDhadrPtyjQ0MMV0EOdmVYwlbUFcZgM RvJfSyGV1iJZIyJBC6T3QSjbCi9luBW1ex1vnuORAcS7v63yskoJ9PQnpvJ/nXi87sZG YBIrom7PXWFZGfNto7Nso7UlS5CYjK/QFWgfowoUK4EnzG2i97EI4b+pInq/UL+Vdauy 9DwcXlIDyI5V5YXdkfiDVIUGSMMim3b7qNJOWxPFyVB+7XTEuDsgIJn4KEMUDytdrH9/ bgOE5b9M3I2iWT8kYwprwXLzAACrQxt+GpRcpY8LPHpXgSxtf2CR5VOHBLea+9iE0SH5 21VA== X-Gm-Message-State: AGRZ1gLrwdWC1jKDAkll8BYYhE8VozJR48utpLtTGItcrH/iu5Noz4ch kc/HV8bPT4XdETNUjYnbVU4KdKQn674Grw== X-Received: by 2002:a81:1153:: with SMTP id 80-v6mr5033780ywr.302.1540582935666; Fri, 26 Oct 2018 12:42:15 -0700 (PDT) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com. [209.85.219.182]) by smtp.gmail.com with ESMTPSA id h68-v6sm2660808ywd.88.2018.10.26.12.42.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 12:42:14 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id f15-v6so454618ybq.13 for ; Fri, 26 Oct 2018 12:42:14 -0700 (PDT) X-Received: by 2002:a25:ac8e:: with SMTP id x14-v6mr5163239ybi.141.1540582933453; Fri, 26 Oct 2018 12:42:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:3990:0:0:0:0:0 with HTTP; Fri, 26 Oct 2018 12:42:12 -0700 (PDT) In-Reply-To: <20181026182218.GB187415@joelaf.mtv.corp.google.com> References: <20181026180042.52199-1-joel@joelfernandes.org> <20181026180042.52199-6-joel@joelfernandes.org> <20181026182218.GB187415@joelaf.mtv.corp.google.com> From: Kees Cook Date: Fri, 26 Oct 2018 20:42:12 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 6/6] Revert "pstore/ram_core: Do not reset restored zone's position and size" To: Joel Fernandes Cc: LKML , kernel-team@android.com, Anton Vorontsov , Colin Cross , Tony Luck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 26, 2018 at 7:22 PM, Joel Fernandes wrote: > On Fri, Oct 26, 2018 at 07:16:28PM +0100, Kees Cook wrote: >> On Fri, Oct 26, 2018 at 7:00 PM, Joel Fernandes (Google) >> wrote: >> > This reverts commit 25b63da64708212985c06c7f8b089d356efdd9cf. >> > >> > Due to the commit which is being reverted here, it is not possible to >> > know if pstore's messages were from a previous boot, or from very old >> > boots. This creates an awkard situation where its unclear if crash or >> > other logs are from the previous boot or from very old boots. Also >> > typically we dump the pstore buffers after one reboot and are interested >> > in only the previous boot's crash so let us reset the buffer after we >> > save them. >> > >> > Lastly, if we don't zap them, then I think it is possible that part of >> > the buffer will be from this boot and the other parts will be from >> > previous boots. So this revert fixes all of this by calling >> > persistent_ram_zap always. >> >> I like the other patches (comments coming), but not this one: it's >> very intentional to keep all crashes around until they're explicitly >> unlinked from the pstore filesystem from userspace. Especially true >> for catching chains of kernel crashes, or a failed log collection, >> etc. Surviving multiple reboots is the expected behavior on Chrome OS >> too. > > Oh, ok. Hence the RFC tag ;-) We can drop this one then. I forgot that > unlinking was another way to clear the logs. In another thread I discovered that the "single prz" ones actually _are_ zapped at boot. I didn't realize, but it explains why pmsg would vanish on me sometimes. ;) I always thought I was just doing something wrong with it. (And I wonder if it's actually a bug that pmsg is zapped -- console doesn't matter: it's overwritten every boot by design.) -- Kees Cook