Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp972577ybk; Fri, 15 May 2020 19:45:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZwh1KJyK5Ow42eLmAa26j0QPGQ/MRShzUBefXVmInsREiOOzgwqMxg3tskOBo2B7hIhIY X-Received: by 2002:aa7:c60c:: with SMTP id h12mr5175511edq.243.1589597111773; Fri, 15 May 2020 19:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589597111; cv=none; d=google.com; s=arc-20160816; b=EUbdJb1b3CKA7Kvb3BYpXw5U6Ra6IBVlb9bU9zGpChPt+K+Tv0/jNnnkdSesOtiO3B yYke7JZwPTvDoR4O/iDhSHslGBcoOAwoX/47cR/Gh+hwdpZ6HUog9wno9Ltl2mO+zpt9 ivNjtG0jBkBYZCO3GfzaGkBvCW9lVLs3ld1sm9LOPlUAWeDYL4+IJ3NEzQmH/pocFLV1 luUUTz8mN++4bcuIEjkBRk09ZiyHbYSCUAAdzxQBZ/MVh+qPraiU1VPdQuYcXfke0oG4 rP/8l2MRaA7Hu3R+TFnItnXNKYkc9DM7rJltORpYu6EpTnzp507f0oy+Y9qiYUg+B4s0 9KOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cglgAeogEsYtyEtsWWA7EKVu4oJhwNRDGYnJtkMLvSQ=; b=gXYCSK455HsILGXwZaqFe8naqvasz4JTvsaHFTOejDo8AFn2hDubTTnqxEY8ksWiwl uRpS98WqbZrLO/HQkUGPl17YyDalC10ZXJgkoIjwQ0d8W4SKeN8m9CAEMsy2NqdpSOH7 duEbG5dIG8QD031CVoAERQrNE1Ea6ZYOUTI7DY/QSbhRjIsztOJ7OeW6YWtlkqcnbFys eEwziDKQ49Y8Mp1xzvzrjtTMWqYccH5QAtgf+0XnayXav29+xuAl6poNX85wKyhGhhwC qX8210TRceDbS/e75U8WsrIhK9CS4JwglFkcMg/KfHwYfFKnrV02a20/aiGzUpbn98sr GEuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KMWk+NQS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m4si2050585edv.63.2020.05.15.19.44.47; Fri, 15 May 2020 19:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KMWk+NQS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727768AbgEPCna (ORCPT + 99 others); Fri, 15 May 2020 22:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726550AbgEPCn3 (ORCPT ); Fri, 15 May 2020 22:43:29 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DC48C05BD0A for ; Fri, 15 May 2020 19:43:29 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t40so1833144pjb.3 for ; Fri, 15 May 2020 19:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cglgAeogEsYtyEtsWWA7EKVu4oJhwNRDGYnJtkMLvSQ=; b=KMWk+NQSpb/1CpN3DQS0NjXCMJ3eK4oWJD3mIbC84O3JQ9n96BQD6KOyhnPvS5ni1S +LW+Dgeew7NVywcQinZhWtU6ACEpt6oc6Fjk7HDeg16n1/ogtorphBRVCGPnaJ1vZtlw TbKbeHURR9Q1QRxtyEOEjpW0BGcjNbmBJhkKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cglgAeogEsYtyEtsWWA7EKVu4oJhwNRDGYnJtkMLvSQ=; b=EBuDbUTGVI9qsxvGWrSsKpMAi5cO9CrDgsJyO+C/7RDbQHLhCmtdOLMkBLRvlPcu4s /3QeIT4UHUzEWxadkdC9HtGM5mPLu7x36ppcFZySVTu0+5x8z+ISItyQv9sQ0CVh3T7b 7U6O83L1BA+JTglY8z/cXJmeKYCl4tYrS51mFtBbRn+ZgGedCS3TptMuVZkJ1uttwzuH 9pXRjj1zmehvbtqBgQG0WznW/FRkbht3FJigPOP5MmAykrPPr0hVeVZYCXDcqszCslQ0 d3CudsZUCsXLYMICP54zQRvcKSJOLECYld9qOGof8AGLybJbLtl9rjfL1aKHUFfcPjcL nHdQ== X-Gm-Message-State: AOAM532greal1mPVgVvWYWizXhXsvvRH4SYSW/JxNI3Weh6wXlBkrC50 XsbEPscuY++TUCtQX9i5NpnonA== X-Received: by 2002:a17:90a:30ef:: with SMTP id h102mr6727633pjb.110.1589597008980; Fri, 15 May 2020 19:43:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a30sm2731879pgm.44.2020.05.15.19.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 19:43:27 -0700 (PDT) Date: Fri, 15 May 2020 19:43:26 -0700 From: Kees Cook To: Tyler Hicks Cc: Pavel Tatashin , Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Rob Herring , Benson Leung , Enric Balletbo i Serra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , jmorris@namei.org, sashal@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 4/6] pstore/ram: Introduce max_reason and convert dump_oops Message-ID: <202005151942.830CDF8E@keescook> References: <20200506211523.15077-1-keescook@chromium.org> <20200506211523.15077-5-keescook@chromium.org> <20200512233504.GA118720@sequoia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512233504.GA118720@sequoia> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 06:35:04PM -0500, Tyler Hicks wrote: > On 2020-05-06 14:15:21, Kees Cook wrote: > > @@ -954,7 +965,11 @@ static void __init ramoops_register_dummy(void) > > pdata.console_size = ramoops_console_size; > > pdata.ftrace_size = ramoops_ftrace_size; > > pdata.pmsg_size = ramoops_pmsg_size; > > - pdata.dump_oops = dump_oops; > > + /* Parse deprecated module param "dump_oops" into "max_reason". */ > > + if (ramoops_dump_oops != -1) > > + pdata.max_reason = ramoops_dump_oops ? KMSG_DUMP_OOPS > > + : KMSG_DUMP_PANIC; > > + pdata.max_reason = ramoops_max_reason; > > This isn't quite right. We're conditionally assigning pdata.max_reason > and then immediately re-assigning it. > > IIUC, we're just missing an else block and it should look like this: > > /* Parse deprecated module param "dump_oops" into "max_reason". */ > if (ramoops_dump_oops != -1) > pdata.max_reason = ramoops_dump_oops ? KMSG_DUMP_OOPS > : KMSG_DUMP_PANIC; > else > pdata.max_reason = ramoops_max_reason; Whoops, I forgot to CC you Tyler! This should be fixed now here: https://lore.kernel.org/lkml/20200515184434.8470-6-keescook@chromium.org/ -- Kees Cook