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=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 8B89AC433DF for ; Wed, 8 Jul 2020 03:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68DE120738 for ; Wed, 8 Jul 2020 03:39:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FQQtzi6p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729516AbgGHDjl (ORCPT ); Tue, 7 Jul 2020 23:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728325AbgGHDjk (ORCPT ); Tue, 7 Jul 2020 23:39:40 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BBB6C061755 for ; Tue, 7 Jul 2020 20:39:40 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id q15so1412597wmj.2 for ; Tue, 07 Jul 2020 20:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=b0MSJMdXbeUzupb6r6J9CAUvaKsjI0cyEb04d76sLig=; b=FQQtzi6pac89mpD8yPE44MbmGtJ0ORE4LYJxuPMmzpDJWXj0X8LHEiqANk+eASg7c8 ng/jVO+ZvK3Ysf2i3PMvk1hBzAT+ZyBQ2Tqw+eVxuExQ6bmG4CMOoqzzxl2WxK8zpa1m es0R2Dv85+SCrQP2aHmxJKslvvxPqnvpkpuIk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=b0MSJMdXbeUzupb6r6J9CAUvaKsjI0cyEb04d76sLig=; b=bvvmfiJAQpxUKpNlMqJeuxVsB3XqqitEietVmLw6I2inhGvbTrtm0b8PeSMvYlPclL 3SNiMqRVrY4l0ZX7YDqryB6nR5LkfsIDJ3DflZyTuYZwLBc78qplhEKn68qz6c59SJTN XWvdmHbry3sJYpB7bxoWK+7QltTdTxwR6Q/lrWMz9LBNCmTWnUYLO2VHNdE3Qtzg+l4+ 418wqYzODPTpyOh6bXV+tIw2sOzV+UmYlQ1SpOXNiV7XARrPVYqdyithQen0iS5vfYCB hbJo/pG5EtZIFmvDMN/Yt8S1TK1iL3FCA9aolBN42zpNMN53i/Q/jJVt2rmp5u0FK9H9 gDHQ== X-Gm-Message-State: AOAM533GD4VpTDm6EESSIm4oWiI1ln+aCwg6VOBWDZe/qqO538lmHgCS PcG1E0V6yE3Uk1flZIEkKDNAXw== X-Google-Smtp-Source: ABdhPJz2S9+QMAFIAx7Px3unr1ipJo9bqmjdbN368KnmW5gZno1/2MSNEHbx4ymeujbmKIvaZ51Mkw== X-Received: by 2002:a7b:c38f:: with SMTP id s15mr7000017wmj.152.1594179578758; Tue, 07 Jul 2020 20:39:38 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id 69sm189961wma.16.2020.07.07.20.39.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jul 2020 20:39:38 -0700 (PDT) Subject: Re: [PATCH v10 1/9] fs: move kernel_read_file* to its own include file To: Kees Cook Cc: Luis Chamberlain , Wolfram Sang , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , Mimi Zohar , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org References: <20200706232309.12010-1-scott.branden@broadcom.com> <20200706232309.12010-2-scott.branden@broadcom.com> <202007071637.ABF914AB@keescook> From: Scott Branden Message-ID: <0a3ab4c9-ee04-1cc9-6e1b-3911d58d3787@broadcom.com> Date: Tue, 7 Jul 2020 20:39:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202007071637.ABF914AB@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-07 4:40 p.m., Kees Cook wrote: > On Mon, Jul 06, 2020 at 04:23:01PM -0700, Scott Branden wrote: >> Move kernel_read_file* out of linux/fs.h to its own linux/kernel_read_file.h >> include file. That header gets pulled in just about everywhere >> and doesn't really need functions not related to the general fs interface. >> >> Suggested-by: Christoph Hellwig >> Signed-off-by: Scott Branden >> Reviewed-by: Christoph Hellwig >> Acked-by: Greg Kroah-Hartman >> --- >> drivers/base/firmware_loader/main.c | 1 + >> fs/exec.c | 1 + >> include/linux/fs.h | 39 ---------------------- >> include/linux/ima.h | 1 + >> include/linux/kernel_read_file.h | 52 +++++++++++++++++++++++++++++ >> include/linux/security.h | 1 + >> kernel/kexec_file.c | 1 + >> kernel/module.c | 1 + >> security/integrity/digsig.c | 1 + >> security/integrity/ima/ima_fs.c | 1 + >> security/integrity/ima/ima_main.c | 1 + >> security/integrity/ima/ima_policy.c | 1 + >> security/loadpin/loadpin.c | 1 + >> security/security.c | 1 + >> security/selinux/hooks.c | 1 + >> 15 files changed, 65 insertions(+), 39 deletions(-) >> create mode 100644 include/linux/kernel_read_file.h > This looks like too many files are getting touched. If it got added to > security.h, very few of the above .c files will need it explicitly > added (maybe none). Some people want the header file added to each file that uses it, others want it in a common header file.  I tried to add it to each file that uses it. But if the other approach is to be followed that could be done. > You can test future versions of this change with an > allmodconfig build and make sure you have a matching .o for each .c > file that calls kernel_read_file(). :) > > But otherwise, sure, seems good. >