From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73765C7618B for ; Mon, 29 Jul 2019 16:51:26 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id C3B28206A2 for ; Mon, 29 Jul 2019 16:51:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eEZM3QuE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3B28206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-16619-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 7654 invoked by uid 550); 29 Jul 2019 16:51:19 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 7632 invoked from network); 29 Jul 2019 16:51:18 -0000 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=MxzGHRyUF0O1PB/ltZVyxrWyNUwKzm+EJuwbXoWFJjRuEN0SrHIR/+zxr7mDlzWWLv FrOvUQON8uRETwN3TR/cau+U61VCf0GTj9WsLc1064CnxNRJN0NVS438BAPHqEKe38gh pJ0eR4cytjHgslXqCEBYcbs8+KFq73LVNpXxUow/F4PlioAykLLyZqPWTlVxOJyMKso+ iSYqU6AWY8hjf/1pTokGB8eqRb2CgKniaPyEPYoBqyFjNYbrOffU6XNg90kJB6iClq3+ 3zflJOhHGAkJORGzCXBO4ntSFv9mAPvGZv3cDSvu8s6RvwwysrNg2VqzTJO46HBtT+iL /59w== X-Gm-Message-State: APjAAAUPROj8xPsTwKlpfuN7phUwQeCmtYJz/eF5hBssGm8bbqfiwgrC AzIj226DF6lxM9GAvP55oDqllA== X-Google-Smtp-Source: APXvYqypNtAKQJZGTSkV39u4c7GLeVZyMUhrP0VaoGlM65upiz6NEPGMAURh5q4KoDvXmPMGybRvRQ== X-Received: by 2002:aa7:9713:: with SMTP id a19mr19643019pfg.64.1564419066457; Mon, 29 Jul 2019 09:51:06 -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: 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