Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3647033ybi; Mon, 29 Jul 2019 10:04:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz05N6bh422daSjv59iOh02JbwBAJBGPteyob2cc3ZWvv+4cEjpqW1FKntkjkwEFMA2umD X-Received: by 2002:a17:902:bb81:: with SMTP id m1mr27292401pls.125.1564419868870; Mon, 29 Jul 2019 10:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564419868; cv=none; d=google.com; s=arc-20160816; b=vIgLgJD/nPMbLlPitk/Z2S0Q28oJDkiXjI6ZHUWkWqBM6PRqSluVWEzjug4nG8mnB1 RKbbORkxOdi8UT5bUU8QA0Cx7XrvkZsWYGX6MBOBE6q6q/2pSCBuyfhqIiBVbLR/9PDp RGxMiOWu7x230OJ1iKDpr2HygWfuCSBzgAnGnUmuzOIMw93QdNIVvVb3Il4MHZ8kjk+a wDBcoQW9KIByd3p3nD01e0V8eHQHVGQzhGESAsCTcoSQgr4AR6UlKs8PSG5zDUtPRSAS PK2qAWydjoz7TSBjbWpaIDzcE2bAg29maFTTKKCfW3OcBJ0oCJHA7fY3AgkQXyb7LBIF MPow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aoG/CujPMfUNVlv4vKQLSR0pGlxHql1vt1xZ+SM2evU=; b=zm6StJ16IZ05rkYxXEucqkLfaHpH6YLEuZBemXbhnT3bXhD8HFtMr7ttdRijFx1KPC mR7KPs5KfrqcE6qRVExVrieX/tpSC0HUGb4ABC41rHaYv0WVyZlVxfJ/3IOFDnQWwpjc EiwRVn0/IF1e0ffJJU4F9pIwWytXKE49imK/CgHhPfU2PkOkPQIdrVxnhcO9wvQROO/M VyMET1VNpmdrjzpIW1oP+soJWAYq3k/7rj+MQyhdOdMwULKjP431SM6faIxV3udL8xzy 6XKLd9QkdP3ZWh1EkC1yrnMZuJUVwRgXxfJjbaz8YE2uJ3+8IjrOmGHEzNNNk0mTmZLf 0erg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eEZM3QuE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si25499447pls.424.2019.07.29.10.04.13; Mon, 29 Jul 2019 10:04:28 -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=pass header.i=@chromium.org header.s=google header.b=eEZM3QuE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728905AbfG2QvI (ORCPT + 99 others); Mon, 29 Jul 2019 12:51:08 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41437 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728895AbfG2QvH (ORCPT ); Mon, 29 Jul 2019 12:51:07 -0400 Received: by mail-pf1-f195.google.com with SMTP id m30so28337463pff.8 for ; Mon, 29 Jul 2019 09:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aoG/CujPMfUNVlv4vKQLSR0pGlxHql1vt1xZ+SM2evU=; b=eEZM3QuEtJ4JN4mdaj3YgffjMFlESFvZpNvVSBcO8QjQXXQKXPwrx7oRmFKdAFTv4O e6RMip7uGYfZRrmSxbKwzN3jKE4oPiG8D2pbJVibHbEQZSrsU0IkrOey1LwO4ytEt5eV z+gXkKTFPBu2RM4tpLhAffP4/wgkBIsBwtriU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aoG/CujPMfUNVlv4vKQLSR0pGlxHql1vt1xZ+SM2evU=; b=gYMu1qojDa4nIxc2yR4JNf4n0DPtrGYhaj8YXwF0K5dnFbxkTRno8Hpmz1PeDL+iZV nTNSz64TpSFmj40R6DZuQwC+OGfjkYu+nZKFBySgokRccBfS4l6e0OZ5lhJmplGFThBQ HK+2gVpIvLqlUmXxtj0sAUMRf4rgrHpnlZY7pHocKHL1Fsjb9cVpOQk2ElAewyFmvQF2 poQKwt1qkL+5CpE9NvY0icRI5cbMZt/IoKQ96dRd8kKXQBPr9mWwoevO5JpK4eH3gAjG v3UOM3DTQ75IrvyxcleDdD6dxdGaiPKi8XF0RNknV2bzbvDmGdKLyCozf/lLr1NP+K3M cVEA== X-Gm-Message-State: APjAAAUXVa1OhERAcNF1wNG98euz/7qfrbShw1h+HQBO/Pc0RFRievuf k/UIhpxgkzwQysQFNu9pRokvRhyYDug= X-Received: by 2002:aa7:9713:: with SMTP id a19mr19643019pfg.64.1564419066457; Mon, 29 Jul 2019 09:51:06 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j1sm85432865pgl.12.2019.07.29.09.51.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jul 2019 09:51:05 -0700 (PDT) Date: Mon, 29 Jul 2019 09:51:04 -0700 From: Kees Cook To: Jann Horn Cc: Ondrej Mosnacek , NitinGote , Kernel Hardening , Paul Moore , Stephen Smalley , Eric Paris , SElinux list , Linux kernel mailing list Subject: Re: [PATCH] selinux: convert struct sidtab count to refcount_t Message-ID: <201907290949.D08EC0379C@keescook> References: <20190722113151.1584-1-nitin.r.gote@intel.com> <201907231516.11DB47AA@keescook> <201907240852.6D10622B2@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 06:55:47PM +0200, Jann Horn wrote: > (Accurate) statistics counters need RMW ops, don't need memory > ordering, usually can't be locked against writes, and may not care > about wrapping. > This thing doesn't need RMW ops, does need memory ordering, can be > locked against writes, and definitely shouldn't wrap. > > I agree that there are a bunch of statistics counters in the kernel, > and it's not necessarily a bad idea to use a separate type for them; > but this is not a statistics counter. Right, yes, I didn't meant to suggest it should be. I was just bringing up the "counter type" idea again, since it was on my mind here originally. -- Kees Cook