From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751521AbdISQFZ (ORCPT ); Tue, 19 Sep 2017 12:05:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40354 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdISQFW (ORCPT ); Tue, 19 Sep 2017 12:05:22 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 575B0267C4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dhowells@redhat.com Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20170918183703.114134-1-ebiggers3@gmail.com> References: <20170918183703.114134-1-ebiggers3@gmail.com> To: Eric Biggers Cc: dhowells@redhat.com, keyrings@vger.kernel.org, Michael Halcrow , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers , stable@vger.kernel.org Subject: Re: [PATCH] KEYS: prevent creating a different user's keyrings MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29683.1505837120.1@warthog.procyon.org.uk> Date: Tue, 19 Sep 2017 17:05:20 +0100 Message-ID: <29684.1505837120@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Sep 2017 16:05:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Biggers wrote: > Fix it by marking user and user session keyrings with a flag > KEY_FLAG_UID_KEYRING. Then, when searching for a user or user session > keyring by name, skip all keyrings that don't have the flag set. I wonder if it's better just to reject attempts to manually create/join keyrings of such names. PAM uses the implicit creation method of specifying the 'macro' key IDs for these keyrings. David