From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbdISQJH (ORCPT ); Tue, 19 Sep 2017 12:09:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52952 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbdISQJF (ORCPT ); Tue, 19 Sep 2017 12:09:05 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8D2AC3E2A9 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: <20170918183723.114253-1-ebiggers3@gmail.com> References: <20170918183723.114253-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 KEYCTL_READ on negative key MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30123.1505837342.1@warthog.procyon.org.uk> Date: Tue, 19 Sep 2017 17:09:02 +0100 Message-ID: <30124.1505837342@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:09:05 +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_NEGATIVE, &key->flags)) { > + ret = -ENOKEY; > + goto error2; > + } It might be better to do this check in key_validate(). Also, it should perhaps take the error from key->reject_error. David