All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Kees Cook <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	David Sterba <dsterba@suse.com>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH] refcount: always allow checked forms
Date: Wed, 11 Jul 2018 06:44:21 +0100	[thread overview]
Message-ID: <20180711054421.qgsdctwtncr32r4y@salmiak> (raw)
In-Reply-To: <CAGXu5jLATGcq_mgetUurBriCaPmBQmBwxVW7aa9fAKM2XeSjHw@mail.gmail.com>

On Tue, Jul 03, 2018 at 11:30:38AM -0700, Kees Cook wrote:
> On Tue, Jul 3, 2018 at 3:01 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> > In many cases, it would be useful to be able to use the full
> > sanity-checked refcount helpers regardless of CONFIG_REFCOUNT_FULL, as
> > this would help to avoid duplicate warnings where callers try to
> > sanity-check refcount manipulation.
> >
> > This patch refactors things such that the full refcount helpers were
> > always built, as refcount_${op}_checked(), such that they can be used
> > regardless of CONFIG_REFCOUNT_FULL. This will allow code which *always*
> > wants a checked refcount to opt-in, avoiding the need to duplicate the
> > logic for warnings.
> >
> > There should be no functional change as a result of this patch.
> >
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Boqun Feng <boqun.feng@gmail.com>
> > Cc: David Sterba <dsterba@suse.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Will Deacon <will.deacon@arm.com>
> 
> Looks good to me! Thanks for doing this. :)

Thank David; I rather stole his thunder here.

> Acked-by: Kees Cook <keescook@chromium.org>
> 
> > ---
> >  include/linux/refcount.h | 27 +++++++++++++++++-------
> >  lib/refcount.c           | 53 +++++++++++++++++++++++-------------------------
> >  2 files changed, 45 insertions(+), 35 deletions(-)
> >
> > Dave pointed out that it would be useful to be able to opt-in to full checks
> > regardless of CONFIG_REFCOUNT_FULL, so that we can simplify callsites where we
> > always want checks. I've spotted a few of these in code which is still awaiting
> > conversion.
> 
> Yeah, I need to go through the cocci output -- Elena had several
> outstanding patches that never got picked up.
> 
> > I'm assuming that the atomics group is intended to own the refcount code, even
> > though this isn't currently the case in MAINTAINERS.
> 
> That's how it has landed in the past, yes, but if there is a
> dependency on these for code that will use it, maybe it should go that
> way?

That sounds reasonable to me. I was just wanted to be clear as to why I'd Cc'd
the atomics maintainers. :)

I'll spin a v2 with the fixup Andrea noted.

Thanks,
Mark.

  reply	other threads:[~2018-07-11  5:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 10:01 [PATCH] refcount: always allow checked forms Mark Rutland
2018-07-03 10:33 ` Andrea Parri
2018-07-03 11:39   ` Mark Rutland
2018-07-03 18:30 ` Kees Cook
2018-07-11  5:44   ` Mark Rutland [this message]
2018-07-04  8:46 ` David Sterba
2018-07-11  5:49   ` Mark Rutland
2018-07-11 17:37     ` David Sterba
2018-07-12 12:08       ` Mark Rutland

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=20180711054421.qgsdctwtncr32r4y@salmiak \
    --to=mark.rutland@arm.com \
    --cc=boqun.feng@gmail.com \
    --cc=dsterba@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.