From: Kees Cook <keescook@chromium.org>
To: dsterba@suse.cz, Will Deacon <will@kernel.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Elena Reshetova <elena.reshetova@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Hanjun Guo <guohanjun@huawei.com>
Subject: Re: [RESEND PATCH v4 03/10] lib/refcount: Remove unused refcount_*_checked() variants
Date: Thu, 21 Nov 2019 09:11:58 -0800 [thread overview]
Message-ID: <201911210910.81231377F@keescook> (raw)
In-Reply-To: <20191121145533.GZ3001@twin.jikos.cz>
On Thu, Nov 21, 2019 at 03:55:33PM +0100, David Sterba wrote:
> On Thu, Nov 21, 2019 at 11:58:55AM +0000, Will Deacon wrote:
> > The full-fat refcount implementation is exposed via a set of functions
> > suffixed with "_checked()", the idea being that code can choose to use
> > the more expensive, yet more secure implementation on a case-by-case
> > basis.
> >
> > In reality, this hasn't happened, so with a grand total of zero users,
> > let's remove the checked variants for now by simply dropping the suffix
> > and predicating the out-of-line functions on CONFIG_REFCOUNT_FULL=y.
>
> I am still interested in the _checked versions and have a WIP patch that
> adds that to btrfs (that was my original plan) but haven't had enough
> time to finalize it. The patch itself is simple, the missing part is to
> understand and document what the saturated counters would do with the
> structures.
The good news is that this series removes the case of refcount_t _not_
being checked, so there's no need for _checked helpers.
CONFIG_REFCOUNT_FULL gets removed because all refcount_t ends up being
checked on all architectures. No extra work needed! :) (See patch 8)
--
Kees Cook
next prev parent reply other threads:[~2019-11-21 17:12 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 11:58 [RESEND PATCH v4 00/10] Rework REFCOUNT_FULL using atomic_fetch_* operations Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 01/10] lib/refcount: Define constants for saturation and max refcount values Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 02/10] lib/refcount: Ensure integer operands are treated as signed Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 03/10] lib/refcount: Remove unused refcount_*_checked() variants Will Deacon
2019-11-21 14:55 ` David Sterba
2019-11-21 17:11 ` Kees Cook [this message]
2019-11-21 17:17 ` David Sterba
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 04/10] lib/refcount: Move bulk of REFCOUNT_FULL implementation into header Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: Move the bulk of the REFCOUNT_FULL implementation into the <linux/refcount.h> header tip-bot2 for Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 05/10] lib/refcount: Improve performance of generic REFCOUNT_FULL code Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2020-02-26 4:10 ` [RESEND PATCH v4 05/10] lib/refcount: " Jann Horn
2020-02-28 10:43 ` Will Deacon
2020-03-02 13:06 ` Jann Horn
2019-11-21 11:58 ` [RESEND PATCH v4 06/10] lib/refcount: Move saturation warnings out of line Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:58 ` [RESEND PATCH v4 07/10] lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:59 ` [RESEND PATCH v4 08/10] refcount: Consolidate implementations of refcount_t Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-12-01 15:49 ` [refcount] d2d337b185: WARNING:at_lib/refcount.c:#refcount_warn_saturate kernel test robot
2019-12-02 9:43 ` Ard Biesheuvel
2019-12-03 8:01 ` [LKP] " Rong Chen
2019-12-03 8:09 ` Will Deacon
2019-12-03 8:42 ` Rong Chen
2019-11-21 11:59 ` [RESEND PATCH v4 09/10] lib/refcount: Remove unused 'refcount_error_report()' function Will Deacon
2019-11-25 8:19 ` [tip: locking/core] locking/refcount: " tip-bot2 for Will Deacon
2019-11-21 11:59 ` [RESEND PATCH v4 10/10] drivers/lkdtm: Remove references to CONFIG_REFCOUNT_FULL Will Deacon
2019-11-25 8:19 ` [tip: locking/core] lkdtm: " tip-bot2 for Will Deacon
2019-11-21 12:07 ` [RESEND PATCH v4 00/10] Rework REFCOUNT_FULL using atomic_fetch_* operations Ard Biesheuvel
2019-11-22 3:44 ` Hanjun Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201911210910.81231377F@keescook \
--to=keescook@chromium.org \
--cc=ard.biesheuvel@linaro.org \
--cc=dsterba@suse.cz \
--cc=elena.reshetova@intel.com \
--cc=guohanjun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome