Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp13901ybi; Thu, 30 May 2019 19:24:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDTzc8C0k26UmuAxN8AUd+Vw7spncyJzMOqf+ZqmjZz0Qqp/v171NN0oQ3Vx+6v1a7Eee1 X-Received: by 2002:a17:90a:9a8a:: with SMTP id e10mr6392343pjp.109.1559269499371; Thu, 30 May 2019 19:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559269499; cv=none; d=google.com; s=arc-20160816; b=XPbJQzSUwSfgWnzvifXH0LiAOEEWe/45DSVTmVcs5W+8VXu1kgg/KSXq/SjablRZ8Y Sw8h5TlHiAWj8e+ciGby5e9WcQptrbOvdOG3XvSvyR1phsWeDfrOXIV2In7E7j1ALPrz oFUVDNQ3HwMJBPbQqIAhogDzYG9UIr4JwxKWdt7z0cQnjqTl9XUPNeug1SukxGbfC/IH U4taDJ6pGmA2oKfVAsApNeO2gLFcxvn09SRZEY6yXDBfglNKHWLqIfXuVM1A/axb3oDM z/h44d2N63DmMP+4GEtTYlXPV6RvjW577p4J4QN2Je5p9/JTBwqVbiju8Hqlv+qw/gZ5 LB9A== 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=C6kCdn+CvKS1nx6udU5A4u9LPwYaTnkxAuO1T3SqJb0=; b=tyVvo3iFoagEZrKHfNY2YaE0YpoqHuyGN/kpBKl6Ou/9amPOyGCFjrM31eEHGExicy viWrh9jKVLBUH+ZHv+uX7dhncqC/CGRnTi384zo7tXNNbEyDK4DARyrw2eb+q0JwYjsV JmUR6CZkkHN+fTw6tlbTjNNhD+BPR5SuRsPoqOhZRsCCYIM10o+3f9Knj5qVCqHFRYXV 21ZjuVcjMZ+FVUVa04UmU6DXGni7XM2uHN5zyK3L01L4uCugPnkonU8z4mzFw0tWsFFY Ne9GDUjJ23AkzXGsgejHmoZ4dM0mVgzfdAnT21VETbSv74Vp8MMeIJmVpoWqKXzqmQED 4VnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RbyceLt5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o1si4592913pld.142.2019.05.30.19.24.42; Thu, 30 May 2019 19:24:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RbyceLt5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726581AbfEaCXh (ORCPT + 99 others); Thu, 30 May 2019 22:23:37 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38658 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfEaCXg (ORCPT ); Thu, 30 May 2019 22:23:36 -0400 Received: by mail-pf1-f194.google.com with SMTP id a186so4466622pfa.5 for ; Thu, 30 May 2019 19:23:36 -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=C6kCdn+CvKS1nx6udU5A4u9LPwYaTnkxAuO1T3SqJb0=; b=RbyceLt5l0FuwnDm8jJY+ZlgmLAa1lkUjeAdnioFpi5EHrxP/7AvLtYI9ugBMgxbLa 6lcSFslkR1yZ6H/ucNwXO7h5H7GPK8jNPGFrbC3y8bAdiL0TWu19nAGzO89I15a0VEdH ZHoRRCeo8WYucIwyjDPdjqmDFVf3aVYTXTg6U= 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=C6kCdn+CvKS1nx6udU5A4u9LPwYaTnkxAuO1T3SqJb0=; b=ml9Y5yCv8VIAPDRppsa9DyDrH33N6CrvVXrzctmnfzsGWlctsmhNixBoPQ1mVM6Adv BbRsvUged6YForiRiBK3pvp0t88zLCNzZMmtZ6vPm08E1rZPo83m+JGBjU3ye4nBZH+q 8ruVh7p2UAPEdlW3ILSvlkJX7WIxycW24GEu7nY1UyUjCW0gTmb57230OSyzsKSxaHut srUo2+hRE6WZrlMBvNN0FfJmDf/2d4t2e+QQWU0j3BxTYFbHQn8bMRhVLcuKfE13pWoh JmfHFQg2fsCLyL+7FdsmTS6VTlQzYJBGGddYRcTjEAMxF8SwaxByzRsUxXMWEA/nroCt FwsQ== X-Gm-Message-State: APjAAAVm31shiIHJMnKb++AlwpVV46A4K3V87LReLGaZpy/CFbEtuyFN mNvsgfCtQ7LYyFfYBWp8DVd9wQ== X-Received: by 2002:a17:90a:2ec2:: with SMTP id h2mr4402798pjs.119.1559269416094; Thu, 30 May 2019 19:23:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x24sm3775458pjq.27.2019.05.30.19.23.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 May 2019 19:23:35 -0700 (PDT) Date: Thu, 30 May 2019 19:23:34 -0700 From: Kees Cook To: Ke Wu Cc: James Morris , Jonathan Corbet , "Serge E. Hallyn" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v2] Allow to exclude specific file types in LoadPin Message-ID: <201905301921.AE6D8D1@keescook> References: <20190529224350.6460-1-mikewu@google.com> <20190530192208.99773-1-mikewu@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 06:11:44AM +1000, James Morris wrote: > On Thu, 30 May 2019, Ke Wu wrote: > > > Linux kernel already provide MODULE_SIG and KEXEC_VERIFY_SIG to > > make sure loaded kernel module and kernel image are trusted. This > > patch adds a kernel command line option "loadpin.exclude" which > > allows to exclude specific file types from LoadPin. This is useful > > when people want to use different mechanisms to verify module and > > kernel image while still use LoadPin to protect the integrity of > > other files kernel loads. > > > > Signed-off-by: Ke Wu > > --- > > Changelog since v1: > > - Mark ignore_read_file_id with __ro_after_init. > > - Mark parse_exclude() with __init. > > - Use ARRAY_SIZE(ignore_read_file_id) instead of READING_MAX_ID. > > Looks good! > > Reviewed-by: James Morris Thanks! Applied to my for-next/loadpin branch at git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git and should be visible in linux-next in a few days. -- Kees Cook