Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp799080imm; Tue, 5 Jun 2018 04:48:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKARr1030JMdTwPX5iMkGNJoP32pPVfU8V0hLe4RJTXSP2YmB1jSF8UB7TuYFdmUj9HHyDz X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr17840746pgk.434.1528199303484; Tue, 05 Jun 2018 04:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528199303; cv=none; d=google.com; s=arc-20160816; b=WlBboP26obbfcwX/vVBBfcnrxA9p+miIKuNt/IKEg5uDW8wzGKzUqVsxfGpWvMuU+e iRV+SOL8F58gHpV8vmW34AfOnJYP9uQbNodyrMGMVn2HVXIMJg9sBx6bI+C/+j8x38cb 3HCJaSgXGJ6+r28d16PDVBvAHXFP5J1ZI5l2gDMePYzrXro2RxC1waUXY5ntJ/eMT/2y 2qZz4eMn6CDpWaQUEFQFcciNUpr1c1GHuwhqwOSjpPc17/JXwZs+pMaIYklmIf3BuLlT x93Qp+C/LvIR9UDeMgUazfOxd6SYrtyMRHV7zgD/2LjpNANCBbAxG1zVlTguAtLGed4S JV7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=kfMAbb+G0z03hyHrKGgIv8lamIKWZXEc3HZ5i08btdI=; b=SLzcH/9wYv2c2eYQ+mt3veFuYYzrxI+Si+6PGIL2ncwzLHFHbE2jGvCsBVyGxcCxmD A2X8JtS81KfJa4WtvO9SBArZDVy52GGySgEsWLxi7u6a5ObrbGC+9VJxT+8Gy18KhnhL 842ywzrc/2LZ3JlJ635FFXJaWC6ILdwGmaHvR9cKf/sAHvH8tSghguGmrawiZ/sBOf8t uQNJk/APhba/46u9Oc64A92WerGrszzoPCcn6ZzpoNz6+lf0vT08ew81H3eEVaD+oGU9 w2LV8kJrUTgVrOS25tFyTn4qlUdN58D9uvyUFEHVOJYi06Qsyenzuq6UsVusJxFVeDvI c6eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SU80Tg+u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si47197202plz.356.2018.06.05.04.48.06; Tue, 05 Jun 2018 04:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SU80Tg+u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbeFELrk (ORCPT + 99 others); Tue, 5 Jun 2018 07:47:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56040 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbeFELrf (ORCPT ); Tue, 5 Jun 2018 07:47:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kfMAbb+G0z03hyHrKGgIv8lamIKWZXEc3HZ5i08btdI=; b=SU80Tg+uktOPTK5CIO9fhkxT+ kIPp1Tdc8c1MMUWsdvvdR+bvLDgNfjLtwVZKYQylGbFE7YfxzgQE/s/baXN4weEAE1VfjHyEjURmE W+PWjU3lJs2Jp65Wm/7sIsk5KcH7liA1cOMZl+C1iyBPklG3KVFBbgMm+xQpiYO33f8ViHl8FVbIT OcM7FmAzNbzaaJyj1wA5+FdArKzwYOxQr/LBqY2LUl/0IwBAw4NxQKvg0ZjfujnsPG8vFmXlF+SgZ x/QuGgg6r5zjgVDVIBm4KR3zDe61Ey26pd58D4F+Vvkox2Mx66BNPJBkL1B4+P0tzO5iwb4A2e+cX YIjoJvZQw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQAR4-000538-P9; Tue, 05 Jun 2018 11:47:34 +0000 Date: Tue, 5 Jun 2018 04:47:34 -0700 From: Matthew Wilcox To: John Johansen Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Use an IDR to allocate apparmor secids Message-ID: <20180605114734.GA20472@bombadil.infradead.org> References: <20180522093259.GA30182@bombadil.infradead.org> <20180528170108.GA5448@bombadil.infradead.org> <862d03b6-ba2f-3ec0-d45e-d8fcf16f9edf@canonical.com> <20180605022712.GB32444@bombadil.infradead.org> <4e075d0a-2e4d-f298-070c-836324864b97@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e075d0a-2e4d-f298-070c-836324864b97@canonical.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 04, 2018 at 07:35:24PM -0700, John Johansen wrote: > On 06/04/2018 07:27 PM, Matthew Wilcox wrote: > > On Mon, Jun 04, 2018 at 06:27:09PM -0700, John Johansen wrote: > >> hey Mathew, > >> > >> I've pulled this into apparmor-next and done the retuning of > >> AA_SECID_INVALID a follow on patch. The reworking of the api to > >> return the specific error type can wait for another cycle. > > > > Oh ... here's what I currently have. I decided that AA_SECID_INVALID > > wasn't needed. > > > well not needed in the allocation path, but definitely needed and it > needs to be 0. > > This is for catching some uninitialized or freed and zeroed values. > The debug checks aren't in the current version, as they were > residing in another debug patch, but I will pull them out into their > own patch. With the IDR, I don't know if you need it for debug. BUG_ON(label != idr_find(&aa_secids, label->secid)) should do the trick.