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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DC6AC47247 for ; Tue, 5 May 2020 23:23:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0696020721 for ; Tue, 5 May 2020 23:23:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Vc55/O8H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0696020721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 427AD8E0005; Tue, 5 May 2020 19:23:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D8C28E0003; Tue, 5 May 2020 19:23:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C6F38E0005; Tue, 5 May 2020 19:23:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 1256A8E0003 for ; Tue, 5 May 2020 19:23:18 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CD8AC824559C for ; Tue, 5 May 2020 23:23:17 +0000 (UTC) X-FDA: 76784243634.01.pigs43_912be8d8d6050 X-HE-Tag: pigs43_912be8d8d6050 X-Filterd-Recvd-Size: 4204 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 May 2020 23:23:17 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id p25so42009pfn.11 for ; Tue, 05 May 2020 16:23:17 -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=F4zJ2Wyns0vWJ/VWVLN8p0gKZwpMoM7NNXMOTPjWGo8=; b=Vc55/O8Hn/65Ur4l0r7kF61Ee72u7Mj2dHcVB8s5vddf1pRLtKJ+SSUOSoa2lEuC83 CtDyJZy6EL9hSjfTI6jsk2VFGvkSJJdGAJwyoEVcJ+htyASspxPGM7k7FAFlYfIr21tO QcEPgHEYgTGpxY4PQYbfhNAYRULqlS6zzszQU= 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=F4zJ2Wyns0vWJ/VWVLN8p0gKZwpMoM7NNXMOTPjWGo8=; b=nl+GhOilwu0IYKq8ggSnzX6noMEm319yeZMxbPZ7nfH6c9Z1UljVbbze2laZLWHrcR xK0OmgK9gqA/gNQJvrLayQ6jK567/rSP43GpVxY55ECZbcJ3uygC+R2UG+Vk2hCk+vd6 iJVZ1Ix6tof12uRfdyMjFhchFeSVCemOP8m7ChePuWEF7uAaqmnX3qT4RyTGdMUH79v5 fgP3Uebw+fIT8A2CptTCkauo6+TVcAEfenxjIHEP+tPSZy2Q904Rccq98F8REmudrWim 0zt1HLTAcSUYgZZEBsiyZAsNphiX7ZSt63lvnJbhUi0MEjPmPHjzlPOdp9cfMaw4W0t7 IWUA== X-Gm-Message-State: AGi0PubIPDUdv6hj3Z+DKGN9wL56RrFcxbulxw8A80mIDnHY4xgjmf4e NMsWA0Sn248eYVPR+nHQoNPJLQ== X-Google-Smtp-Source: APiQypLvtC8n0a9vwNk9Ryexcufu5OYvbfhZPdrSJ4nmiaOmEQoxagwQrmZnsNARoblWFqiBDRVw7w== X-Received: by 2002:a63:ff42:: with SMTP id s2mr4812221pgk.410.1588720996544; Tue, 05 May 2020 16:23:16 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k186sm169139pga.94.2020.05.05.16.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 16:23:15 -0700 (PDT) Date: Tue, 5 May 2020 16:23:14 -0700 From: Kees Cook To: Luis Chamberlain Cc: Greg KH , Christoph Hellwig , Iurii Zaikin , Alexey Dobriyan , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory Message-ID: <202005051621.90DE28B@keescook> References: <202005041205.C7AF4AF@keescook> <20200504195937.GS11244@42.do-not-panic.com> <202005041329.169799C65D@keescook> <20200504215903.GT11244@42.do-not-panic.com> <20200505063441.GA3877399@kroah.com> <202005051339.5F1979C4DF@keescook> <20200505220327.GV11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200505220327.GV11244@42.do-not-panic.com> 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 Tue, May 05, 2020 at 10:03:27PM +0000, Luis Chamberlain wrote: > On Tue, May 05, 2020 at 01:41:44PM -0700, Kees Cook wrote: > > Right -- while it'd be nice if the developer noticed it, it is _usually_ > > an unsuspecting end user (or fuzzer), in which case we absolutely want a > > WARN (and not a BUG![1]) and have the situations handled gracefully, so > > it can be reported and fixed. > > I've been using WARN*() for this exact purpose before, so I am as > surprised as you are bout these concerns. However if we have folks I don't see any mismatch here: it's not user-reachable, which is what Greg said. WARN is for non-user-reachable "impossible situations". We want to know if those can be hit (via bad API usage, races, etc). If it's reachable from userspace, then it can't be a WARN() any more and needs to be pr_warn(). > shipping with panic-on-warn this would be rather detrimental to our > goals. > > Greg, are you aware of folks shipping with panic-on-warn on some products? People shipping with panic_on_warn are expecting to panic for WARNs like this. :P -- Kees Cook