Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1247151lql; Tue, 12 Mar 2024 11:14:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQ5P8crHN+XVZ0x5Gim+UL8O0AaHffEq2QwyddgxgiLuQGX2RUbL0LG/FjOkFqUQ4p0s/6BJ8xj1EQ+6IRXi3EBIcgupZA1iG6+QYQMg== X-Google-Smtp-Source: AGHT+IGR6qNhBb79yLLMHMxBfFFZXG9Zu0XC01cZv8VFgTAzVhKXErLuHSOvhUfnBAD+t2bM1qML X-Received: by 2002:ac2:5970:0:b0:512:d88a:3a8f with SMTP id h16-20020ac25970000000b00512d88a3a8fmr1904218lfp.25.1710267281324; Tue, 12 Mar 2024 11:14:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710267281; cv=pass; d=google.com; s=arc-20160816; b=mX1R2aivmafOXACUwkfBetk4f12oFYNaad6SBDvWZKfbV0Qg698e71PykHY0kzHjNK C86MZ/Zzp9nQzJiqca/DkYXIWBny7Iho3vN/ffGIDtdRkU2ph6RW6Jz1HTP0Wyblm+CY AtnsPWBbQIjt+kTloPCQHZ9xMagnMfLx5sPVzxnTksDhymIqHGQX3320ALekc/x8v5YG Arj5ovR/kl8Cnoesy7g41jTs299ZK/OjpvwzgmGuDoK3FdekhpIp77tLd7EA9TIDf22y p/ByRqhXTAwpCgowRdsqm9iJ8mgf6LwqjZd1IaNrCHPBSdC97dZNKMuqml1xohOzdzJ5 az0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=7A1zrZAVHXKGttwPdOtLQCc2bRvvqSB12WrZItI5omI=; fh=ikBBgD92mzvKcuhUPZs2po/hoEBTuSBHFnPB+za27qg=; b=lma4qMMBJfYxxqdfbcVlz5eguVthuSwNV2JVhXdaPkAO9xGg91MsBk0RMhAGDZvYzP +tFVMbiDuKYcuHHV4tmjRSQluFsBk0DnBgaTUBcpoL9LVPVMPwq1gVmYlFAdDjJOhrUL c9Un+KFgozZcN1a+14wlnGvtgoAU9D15Vw2iplSpVsilXxeof+lsXrqeaeKGfJWsoS4k b6+HQ4kBNCMdyt5dYWRxy7Fq3HlzhIUkWSz77xbUZ8y9zy+QJWKzozNvBnWCH+4clGTK ObGw22FPDDv4zAD3INuZ7NNOQG5CYbt5HxpRi64lk258XcwxtglPQytMhUluxVqoX6de atLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=AwsfC1qr; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-100637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o27-20020a17090611db00b00a45c26fb349si3599160eja.287.2024.03.12.11.14.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 11:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=AwsfC1qr; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-100637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 068011F23234 for ; Tue, 12 Mar 2024 18:14:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F6C213958A; Tue, 12 Mar 2024 18:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="AwsfC1qr" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC8311386D1; Tue, 12 Mar 2024 18:14:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710267268; cv=none; b=ii6o9wR6T65P0zZx966Y/WiySMhdoCoA7KxmgoB7GTtnGB1N+YrrPLAVdYGNwQPu2x6XKffh8p9ZPig73ta4iIpXSdUKEozS8Wnqr8kPB0LNamzHFAb0BEYmr8VzW/6P88G1OFSD0xGaMbz4v1TRugz/vVEVagC43Ys8q4YlL7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710267268; c=relaxed/simple; bh=+Nv8FE2GFtnryYnuFjMt1J6p/3YJi1lq7lWALWFCNLU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nbeMscGtO2pS7tzkLpR05Jywxs2MDt5HsSKG67uBqgrwl4Ehq6JI2wWw4RaDB7L/0N06tKjolxDsvWm5BnFVuqFNNSfjfZOGnla4KzcYtlp+fUT8bzOVP6ezKZn64lYFmp0zwAE9KUP+o4o3VMesMnkJzviG+NjUpqCVr96FRv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=AwsfC1qr; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: from [10.137.106.151] (unknown [167.220.2.23]) by linux.microsoft.com (Postfix) with ESMTPSA id 4696020B74C0; Tue, 12 Mar 2024 11:14:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4696020B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710267266; bh=7A1zrZAVHXKGttwPdOtLQCc2bRvvqSB12WrZItI5omI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AwsfC1qrQaxGBl/fdJD2faD0hl9FFmeBlCLlRgyTQvlkdWZDaVw25t2K6lGQPegFI ykP/qN5yTVNTrsLADx0NdOTg2ngKpt+eyntjyybMaNeHjRlIHLVMavUDIz0AnD7mpo jkZW9SEWeZfy1Nfhg8NaYxMEU0DhvLjCIcb3CkWY= Message-ID: <51810153-eb6e-40f7-b5d0-5f72c2f4ee9b@linux.microsoft.com> Date: Tue, 12 Mar 2024 11:14:26 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v14 15/19] fsverity: consume builtin signature via LSM hook Content-Language: en-CA To: Eric Biggers Cc: corbet@lwn.net, zohar@linux.ibm.com, jmorris@namei.org, serge@hallyn.com, tytso@mit.edu, axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, eparis@redhat.com, paul@paul-moore.com, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, audit@vger.kernel.org, linux-kernel@vger.kernel.org, Deven Bowers References: <1709768084-22539-1-git-send-email-wufan@linux.microsoft.com> <1709768084-22539-16-git-send-email-wufan@linux.microsoft.com> <20240312025712.GE1182@sol.localdomain> <20240312030712.GF1182@sol.localdomain> From: Fan Wu In-Reply-To: <20240312030712.GF1182@sol.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/11/2024 8:07 PM, Eric Biggers wrote: > On Mon, Mar 11, 2024 at 07:57:12PM -0700, Eric Biggers wrote: >> >> As I've said before, this commit message needs some work. It currently doesn't >> say anything about what the patch actually does. >> >> BTW, please make sure you're Cc'ing the fsverity mailing list >> (fsverity@lists.linux.dev), not fscrypt (linux-fscrypt@vger.kernel.org). > > Also, I thought this patch was using a new LSM hook, but I now see that you're > actually abusing the existing security_inode_setsecurity() LSM hook. Currently > that hook is called when an xattr is set. I don't see any precedent for > overloading it for other purposes. This seems problematic, as it means that a > request to set an xattr with the name you chose ("fsverity.builtin-sig") will be > interpreted by LSMs as the fsverity builtin signature. A dedicated LSM hook may > be necessary to avoid issues with overloading the existing xattr hook like this. > > - Eric Thanks for the suggestion. I found that using security_inode_setsecurity() causes issues with SMACK's inode_setsecurity() hook. I will crate a dedicated new hook like security_inode_setsig() in the next version. -Fan