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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5081C433F5 for ; Tue, 11 Oct 2022 20:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbiJKUEQ (ORCPT ); Tue, 11 Oct 2022 16:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiJKUEN (ORCPT ); Tue, 11 Oct 2022 16:04:13 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 344939B856 for ; Tue, 11 Oct 2022 13:04:06 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id i6so9182849pli.12 for ; Tue, 11 Oct 2022 13:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iiS31l/93h6KvcIGG20NGCzdtac4WK0XoSGwVDtqYiA=; b=TZgbCo5pjCweHSqv6LL9cWbHwxNDv6NIvaHUOpCybGso/qwJcYNU66mtle/dJPV6u9 ulbiei3IdX92xNcxCWZSHow5YyyDto/a2h7YYeh5bPxt2CVXCzMvJHrysyZByilhzG+o JMpk/1+4bE8s6sxfpPUCWRhAWwueKEBochaXs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iiS31l/93h6KvcIGG20NGCzdtac4WK0XoSGwVDtqYiA=; b=srTu339/G9EZf/Ag+TH9/JAZCmK4bzp5BJTGt7g2ghOTEmYr9rMGRqLJlRUrGMJIRS Ky2F147546mbe7eqX8mfSc5sVRdWb0/dAtXKMeFiNDlv/CNk+VFnnDdMCmAgZnT2o2of F1FlucE1kOzNRuW1hV7EuaaWE6MhWcBaIzRVDG3sgtg2cxnXO2TwLk6DQ2Vu5BEHvb3S 5DLGqpceEq45LQmkPXHsFfuQmbFAo35lUa1fs8cXskUQSCc7mAH+ku+JLFuNP14De4fd WhuShuJzhiLfQ0JlrIgsEovjfhEFxinU0Sd6GNoeMW7OQvQTs0ShkEoyc471fzBhzh53 IMBg== X-Gm-Message-State: ACrzQf0B6px7KblVJvGgH/47MjOuc11YjlSL+gRe35WTyy9RvgPaschV an9wmUp4cL9xFxjfpbVb6V7Jsw== X-Google-Smtp-Source: AMsMyM7L3RBLFv92acvZmxED1ZGwENjcs6stDtNWL0Qfq5bTTI1QPN8pWlIBQOGIPb7xaLwmrP6ODg== X-Received: by 2002:a17:902:8215:b0:178:6946:a282 with SMTP id x21-20020a170902821500b001786946a282mr26196205pln.162.1665518645976; Tue, 11 Oct 2022 13:04:05 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o66-20020a17090a0a4800b002033b3875eesm8288744pjo.20.2022.10.11.13.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 13:04:05 -0700 (PDT) Date: Tue, 11 Oct 2022 13:04:04 -0700 From: Kees Cook To: Paramjit Oberoi Cc: LKML , Linux-Fsdevel , Dmitry Torokhov , Anton Vorontsov , Colin Cross , Tony Luck Subject: Re: [PATCH 1/1] pstore/ram: Ensure stable pmsg address with per-CPU ftrace buffers Message-ID: <202210111302.3179DB77@keescook> References: <20221011183630.3113666-1-pso@chromium.org> <20221011113511.1.I1cf52674cd85d07b300fe3fff3ad6ce830304bb6@changeid> <202210111209.7F1541F5BE@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 11, 2022 at 12:59:50PM -0700, Paramjit Oberoi wrote: > > Hm, interesting point. Since only ftrace is dynamically sized in this > > fashion, how about just moving the pmsg allocation before ftrace, and > > adding a comment that for now ftrace should be allocated last? > > That is a good idea, and it would solve the problem. > > The only downside is it would break some code that works today because it > ran in contexts where the pmsg address was stable (no per-cpu ftrace > buffers, or power-of-two CPUs). I don't follow? And actually, I wonder about the original patch now -- nothing should care about the actual addresses. Everything should be coming out of the pstore filesystem. -- Kees Cook