Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp478631imn; Wed, 3 Aug 2022 12:01:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dhem5AQSjMn0fItq0mtNq5dSZCRoWOYAKiCJxmVyJ762ZtKi5ofdgdUXaZiyrVChbSNrt X-Received: by 2002:a17:907:8688:b0:730:a1be:ee5 with SMTP id qa8-20020a170907868800b00730a1be0ee5mr7148313ejc.444.1659553317192; Wed, 03 Aug 2022 12:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659553317; cv=none; d=google.com; s=arc-20160816; b=x71OvC5OR7Q/I2Gjq2gFyzMXBc7A1+rg0Gwmus28pIIJe/VPJZMkNx/NXhyjAUvx/7 MhWGSmo29v9REVJadw8RCmrBldFxJjK+oB65nWsrTDPmZB9vcEUy9Aeglv7dZStxH4kE vZFIHtDzKNmuzw1Xj3xL2Y4MFzniaff5OgZrCePTJpiJO4VudT+OMupO0W8RiTvT9TG+ Uw3adilx1XIFPwQ/bK12wqKR4mEh3YGE/Xn9gdQw/hL9Px3T6deStS9HQu3+p8X86Yq9 RDkf4yXOMTlRmZ+ccayVBHIHDz9bLZE70DswbngmtaRS4rjz61/0mLMvbiwyR73myF9W YLeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XLg6GiPZ+WaxLgSNue6U96Q16jVJAJCv1XbzgmfNm98=; b=lSbRmylie/kzCxWoUcGD74SlsBzLl30GAkHlqY+VZxJG1MFOgO3RNYKeZTfbVfLcJR kiJUY6Dv+H1MR4pZmPxfY8fLOJZXiYY5Ede8gsmSVtiWk6NHmQ7QbCTrdZ3ytt+7F4GW ocFUa11iaUuhTmDNwkE7qlMigpfaY6kPoV3gxLoX2QY7d5VyA4EtvO7AdvWdECNsSEgr CzsWlWa7os+sCVrWUMTf8Pel3jbsBFJ3iPKGJflyjIQ+tMyuHxBPctO8cFinHOZjX2/g BXp3DYZXPcur3ktMkTdRLaZWzkSV3k5j4BHVut6/221nlRCtk42W8a204LX2f5fjqvOb lQdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OdqcJr2+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a50cb8d000000b0043ba4ea320esi14273543edi.171.2022.08.03.12.01.32; Wed, 03 Aug 2022 12:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OdqcJr2+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238059AbiHCSZ0 (ORCPT + 99 others); Wed, 3 Aug 2022 14:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234206AbiHCSZY (ORCPT ); Wed, 3 Aug 2022 14:25:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F6363B5 for ; Wed, 3 Aug 2022 11:25:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28B05B82330 for ; Wed, 3 Aug 2022 18:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63C08C433D6; Wed, 3 Aug 2022 18:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659551120; bh=9Ljb7abzn52HuoZKUa9GwMJTqJ4LWPVSB5gBZhJMZGA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OdqcJr2+3QQt64+cVCZ8ymKktWzBkWiuPotYbODBSS6qll2uLYIPDJ9+ZbakvsRTG 5V+oVAxVJPcLoX/1c80nbjtWbjoAve/+F5R989K7Jw4hiLye4TBkEhOXiD2RYs+Pc6 NXXDVrDPRi1xDQGMi2ID8bRTpLHKVuflugheqbVrVk8C/f3edabqAXtsx8+7PjVJA9 JjI+TvUsoVGPA9HuswCKbHBG5xwotd9eq5OApwIFKsMZ7K4VJGqHkL3SR3lorq9h0G 9LFjBTVeLQ1xBfCGQ79WV0mMiumunCpIXTwFPC10ruUqxeA/r4ApKboWxuzOWQnC4x OuYNgv6bfXzIQ== Date: Wed, 3 Aug 2022 18:25:18 +0000 From: Eric Biggers To: Daniil Lunev Cc: Zdenek Kabelac , Brian Geffon , Mike Snitzer , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Mikulas Patocka , Alasdair Kergon Subject: Re: [dm-devel] [PATCH 1/1] dm: add message command to disallow device open Message-ID: References: <20220704000225.345536-1-dlunev@chromium.org> <20220704100221.1.I15b3f7a84ba5a97fde9276648e391b54957103ff@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 03, 2022 at 02:29:40PM +1000, Daniil Lunev wrote: > > This seems like an access control policy, which the Linux kernel already has a > > lot of mechanisms for. Chrome OS already uses SELinux. Couldn't this be solved > > by giving the device node an SELinux label that no one has permission to open? > That would be the ideal solution, but there is a number of challenges > that prevent > us enabling enforcement on all SELinux domains unfortunately. While in the long > run that would be a preferred option, in the short run this doesn't > seem feasible. I > would assume the problem of enabling full SELInux enforcement would plague > any big project that didn't have them enabled from the get going. > --Daniil Have you also considered unlinking the device node (/dev/dm-$idx) from the filesystem after it has been set up for swap? - Eric