Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp391089pxy; Thu, 22 Apr 2021 04:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz80fds2391I2vQugAKmtb0ZAszNrqNk1/hpSMFhWywGgoozm8Xc2g4tiHxzv/K2rriv2tE X-Received: by 2002:a17:906:3509:: with SMTP id r9mr2958712eja.490.1619091725630; Thu, 22 Apr 2021 04:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619091725; cv=none; d=google.com; s=arc-20160816; b=T2aayvBKHMqzWTReoGHVtF+Z2DXQNnU091W94nZa2mNpeOTs45T1KaT9eusiAQuhZH yQUhVDlFkdsO8MXKsDF4nPEhjVk4stWl+UW1R0Nw8X3aqfNfLpBEnOOhCkIh2oj9GFr7 Zuojv1T2G38t6UVPifDwGRlCzeFhIRQSIlpSHZC2/3CxPGvIV9pLYtjs5tKP05/gN4L5 F5yMZ2xMnwmFPXFgCTlJnimHFgDJeV+6oFo6eFFKNWDaU2RGdd0gl6qfZ6ZJRqleQfJm PNosGpeJmZJfRa8nOtvuNoFIORrkTobzfd9TvIdEKYHoa6ihGlYL1GfK10TcwB8+o86S F0hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uMXkQKD92XEqLOdKkZ9LkipLsjeMEu880iIF7KLHuos=; b=S5eg8/+B/Se/jblEW1KTPul5uu+QDuKshCn9jF8r2T3jz89afNvegYjrY+mx4R+zvR 0pL6DqgmqEbS3ahmetDruv8ThUD28Puocdz/67LDbekz6HK5iWaSw8MIDErjx0/2TDpU e4EKSNHiAeR86jztZYv4igJ0CruZIiR3o0P2kc/OVZ4u+4P6kVqDj/0T+QHzJ0dyvXIO Twg7el57GzCgO1ieMwVh8jJkyujMXoswOhlZ81hQ/mrspc8yEWJ+qtCvmpLQxHijcGl0 GsyQT6WnFe/z1y7CVh7PIQ3cxgLLoHDoDZR+x2qdlZHLKrCHHYxKLw7ZAeLHU3nNa3s+ LLsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d7v6HegV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si2018000edr.552.2021.04.22.04.41.42; Thu, 22 Apr 2021 04:42:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d7v6HegV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236040AbhDVLlO (ORCPT + 99 others); Thu, 22 Apr 2021 07:41:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40807 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235977AbhDVLlL (ORCPT ); Thu, 22 Apr 2021 07:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619091636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uMXkQKD92XEqLOdKkZ9LkipLsjeMEu880iIF7KLHuos=; b=d7v6HegVpmxiYScMgtjFRAGyUXwrLofd4EhUcdvEL79bsQ1kCsNILv8ZSDubQwlFecYQ5X XYAxh6DbQf3UWAOikmGrVCH110QmLcrQyT844m3KaUJ5FeZDiLDSEVo0kuk5hNPDZBteQQ 5k7/KpQ6wpeoIrpIhnXnmOSSjbGM0A4= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-yYLuBz4pMCSLBOXAmFVQDg-1; Thu, 22 Apr 2021 07:39:52 -0400 X-MC-Unique: yYLuBz4pMCSLBOXAmFVQDg-1 Received: by mail-yb1-f197.google.com with SMTP id u73-20020a25ab4f0000b0290410f38a2f81so19534978ybi.22 for ; Thu, 22 Apr 2021 04:39:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uMXkQKD92XEqLOdKkZ9LkipLsjeMEu880iIF7KLHuos=; b=Kbi6/5NnO+qR2uZU9d1TY71ryduRI1QdVR9GhZ9M1X1TEEwNrt9ZnI25m8dzmEjUei NMmU8NVWS26el50elKS+sHK31fOGzckgO77MRMP4COVwaimU4KxQ+FkZ7gwe8PUDh+5M 8C1HQ+1mhHj9H99/w4jAXuRd5AtWM2Zwkyry/RvVEKNBIEL1vu71yIiWrrTzQrTCkt/s Af1THuV1jRdTRLM/G4TKyKbRdwsL5uuUiV96j4G6BE5LUHzOvwbSHLBBN0PxiSkSuNzW sDSPItsAzL64kAdDTVDPCacb2Y3cXyLgY0xDsxFugzA8yWoXtTa/s39MvDMioVU4OIhk 2PPA== X-Gm-Message-State: AOAM532L/CnbMXL/vTD9UGitUX+GivFHzPGUPdzsCHRaUOV+9+j6dQLF uTlygw4vCWD2VQTFPJmoRpsietz8/+MjlfmrOZyG5Uv9vZo2yNfPfWJh7YzRpSqYWwZJQ9JYsts L2QsJKKUfCXgyvag7aktcuZpDZzjMecLEfFpb4/eY X-Received: by 2002:a25:7085:: with SMTP id l127mr4068968ybc.293.1619091591518; Thu, 22 Apr 2021 04:39:51 -0700 (PDT) X-Received: by 2002:a25:7085:: with SMTP id l127mr4068951ybc.293.1619091591336; Thu, 22 Apr 2021 04:39:51 -0700 (PDT) MIME-Version: 1.0 References: <20210421171446.785507-1-omosnace@redhat.com> In-Reply-To: From: Ondrej Mosnacek Date: Thu, 22 Apr 2021 13:39:39 +0200 Message-ID: Subject: Re: [RFC PATCH 0/2] selinux,anon_inodes: Use a separate SELinux class for each type of anon inode To: Paul Moore Cc: SElinux list , Linux Security Module list , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux kernel mailing list , Lokesh Gidra , Stephen Smalley Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 10:38 PM Paul Moore wrote: > On Wed, Apr 21, 2021 at 1:14 PM Ondrej Mosnacek wrote: > > > > This series aims to correct a design flaw in the original anon_inode > > SELinux support that would make it hard to write policies for anonymous > > inodes once more types of them are supported (currently only userfaultfd > > inodes are). A more detailed rationale is provided in the second patch. > > > > The first patch extends the anon_inode_getfd_secure() function to accept > > an additional numeric identifier that represents the type of the > > anonymous inode being created, which is passed to the LSMs via > > security_inode_init_security_anon(). > > > > The second patch then introduces a new SELinux policy capability that > > allow policies to opt-in to have a separate class used for each type of > > anon inode. That means that the "old way" will still > > ... will what? :) Whoops, I thought I had gone over all the text enough times, but apparently not :) It should have said something along the lines of: ...will still work and will be used by default. > > I think it would be a very good idea if you could provide some > concrete examples of actual policy problems encountered using the > current approach. I haven't looked at these patches very seriously > yet, but my initial reaction is not "oh yes, we definitely need this". An example is provided in patch 2. It is a generalized problem that we would eventually run into in Fedora policy (at least) with the unconfined_domain_type attribute and so far only hypothetical future types of anon inodes. -- Ondrej Mosnacek Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.