Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5058354pjb; Mon, 27 Jul 2020 11:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCi6Jr21cb+ZtB8FwJqBPsdfqdMent17N39dcZ375jeJgqn8olLscN3mMTKpmZs12kNIdQ X-Received: by 2002:a05:6402:1d0a:: with SMTP id dg10mr21711009edb.110.1595875832899; Mon, 27 Jul 2020 11:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595875832; cv=none; d=google.com; s=arc-20160816; b=qrbz8+stE8ZzSyo0jt2OqhFrf+KRqIURZYyXWVWNgUUYnDt1+YnyrblHeBNxw11e6J 45t12I5mShAN1wkm4ifVr0FURxWqZdf05vgfK7w42cBGYPSFE75JErjshhHxu/hxluNH KhG/KUg/5fXSQs9nI/8WC1rjBCs3MxssegRIffccx8tGB32a1hTPajmWpt4KDHWOxa+i ffWkZjGQIxJh6ZLES0QTzv9qMtcWv3AX8t8cQVpBbmGmyxgvArcYnOQqNhSkPFuTyFRY tft45knH8wnRMqHY6Mld3w3qF8LlPemHyHYsvVe+M9IVRDmn+O7/4jKfmXC/fTXjRiED q2dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=ChYPtu/d3FFvRttM6SdIA545aMKcAivKVYompfrkPS4=; b=BfkB/ChuiuqU/5XgrPFYb+ytJ06tbamUetm8ADvUoaBqh1uOF9/qq2vNpKOuRG2AUm In8FKaP1FNN5Awn3dKfpMfDLOg+/0ofE28sSkleO2K4bVOW5hVmLUMLxcSe6v0HKtl1i E6zient8AMUrwk+yIDdAAePZNj4YiLDwfuEYTmWgO0a/FJD0Emqgcbjhki+OWtZ0d5I5 tGhBvvZ6I4ZtCkkuHqisGEDgN0Arahy/Lg60oPE0icCIO3KRBBuGlj9HB4OdotgjADPR arvrnVjZwfIkYoZiFIgj1asm3jH2kIqTBPpbzaux/zgXBQDVhBArn2Wn8Bbry95TWXOI eGGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J7PC4nMU; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy15si5725140edb.22.2020.07.27.11.50.10; Mon, 27 Jul 2020 11:50:32 -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=@kernel.org header.s=default header.b=J7PC4nMU; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731995AbgG0Q3h (ORCPT + 99 others); Mon, 27 Jul 2020 12:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:58008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgG0Q3g (ORCPT ); Mon, 27 Jul 2020 12:29:36 -0400 Received: from localhost.localdomain (pool-96-246-152-186.nycmny.fios.verizon.net [96.246.152.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3311C20719; Mon, 27 Jul 2020 16:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595867376; bh=8oCB6uea+aVDOj/Yx59qQSnN7cBU25mvgxQKlD5dQsQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=J7PC4nMUIbBazsfj45I5T2O5RZXhlruY1Jd9CA0AJI5vjSA1UL5rdPqK1C7d/pPCV sLTGX0tw+4gnCZQY1RVslJDjjsiq48PwpQFy+rTHxjKdWcEnP6I7CAB4G6haKHwDTC YztTFKyEh1+gVHD8M0jLZgoi7JNzq9DWCvOKvMbE= Message-ID: <1595867374.4841.135.camel@kernel.org> Subject: Re: [PATCH v3 09/19] fs/kernel_read_file: Switch buffer size arg to size_t From: Mimi Zohar To: Kees Cook , Greg Kroah-Hartman Cc: Scott Branden , Luis Chamberlain , Jessica Yu , SeongJae Park , KP Singh , linux-efi@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 27 Jul 2020 12:29:34 -0400 In-Reply-To: <20200724213640.389191-10-keescook@chromium.org> References: <20200724213640.389191-1-keescook@chromium.org> <20200724213640.389191-10-keescook@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-07-24 at 14:36 -0700, Kees Cook wrote: > In preparation for further refactoring of kernel_read_file*(), rename > the "max_size" argument to the more accurate "buf_size", and correct > its type to size_t. Add kerndoc to explain the specifics of how the > arguments will be used. Note that with buf_size now size_t, it can no > longer be negative (and was never called with a negative value). Adjust > callers to use it as a "maximum size" when *buf is NULL. > > Acked-by: Scott Branden > Signed-off-by: Kees Cook Reviewed-by: Mimi Zohar