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 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4E66C19F28 for ; Wed, 3 Aug 2022 18:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659551136; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=It5eCDuJ6YSI9uYfI8cOnSZL+U3RaRNzQsR0g7PcSHU=; b=ek7/2h497T+YUkk6hlpnxs3QvkA3dvaZ78rDXcIdNc0SwkC1YCFcjd5KdZRGqUhsFZrOsq XQsbYp08Fm+zllyxerWEimiSDjkfn3NJ3b6aqncqFWI9pKsl73Ubg34CsZkzrZwyoYs7FL bsuIy2TMM2UZHriC2xue0dfi+nX44dk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-483-58vkqvxuPaq-Ba8VXt7O-A-1; Wed, 03 Aug 2022 14:25:35 -0400 X-MC-Unique: 58vkqvxuPaq-Ba8VXt7O-A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC226185A794; Wed, 3 Aug 2022 18:25:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25A18400EAB2; Wed, 3 Aug 2022 18:25:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D15ED1946A53; Wed, 3 Aug 2022 18:25:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6E71D1946A4E for ; Wed, 3 Aug 2022 18:25:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5193C18EAA; Wed, 3 Aug 2022 18:25:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DD1A18EA8 for ; Wed, 3 Aug 2022 18:25:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31D13101A595 for ; Wed, 3 Aug 2022 18:25:27 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179--E5CCqANNdiVr5lwnWNOSg-1; Wed, 03 Aug 2022 14:25:23 -0400 X-MC-Unique: -E5CCqANNdiVr5lwnWNOSg-1 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 07F41B81F28; 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) Date: Wed, 3 Aug 2022 18:25:18 +0000 From: Eric Biggers To: Daniil Lunev Message-ID: References: <20220704000225.345536-1-dlunev@chromium.org> <20220704100221.1.I15b3f7a84ba5a97fde9276648e391b54957103ff@changeid> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Subject: Re: [dm-devel] [PATCH 1/1] dm: add message command to disallow device open X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Brian Geffon , Mike Snitzer , linux-kernel@vger.kernel.org, Zdenek Kabelac , dm-devel@redhat.com, Mikulas Patocka , Alasdair Kergon Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58CFCC19F28 for ; Wed, 3 Aug 2022 18:25:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238083AbiHCSZ0 (ORCPT ); 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: 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