From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756032AbdJPWJf convert rfc822-to-8bit (ORCPT ); Mon, 16 Oct 2017 18:09:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755120AbdJPWJd (ORCPT ); Mon, 16 Oct 2017 18:09:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8387AC058EB4 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.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: <20171016183141.GD121701@gmail.com> References: <20171016183141.GD121701@gmail.com> <20171012185612.GA11577@gmail.com> <150782504738.1655.12882942775980793687.stgit@warthog.procyon.org.uk> <2176.1507909168@warthog.procyon.org.uk> To: Eric Biggers Cc: dhowells@redhat.com, ebiggers@google.com, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 00/15] KEYS: Fixes MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15165.1508191771.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Mon, 16 Oct 2017 23:09:31 +0100 Message-ID: <15166.1508191771@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 16 Oct 2017 22:09:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Biggers wrote: > > - if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) > > + if (state == KEY_IS_INSTANTIATED) > > atomic_dec(&key->user->nikeys); > > This changes the behavior. Previously ->nikeys counted both negatively and > positively instantiated keys, while this change implies that it now will only > count positively instantiated keys. I think you meant 'state != > KEY_IS_UNINSTANTIATED'? Renaming KEY_IS_INSTANTIATED to KEY_IS_POSITIVE or > KEY_IS_POSITIVELY_INSTANTIATED also might help reduce this confusion. Yeah - I think I'm confusing myself by overloading 'instantiated' in my mind. David