All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Windsor <dwindsor@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Layton <jlayton@poochiereds.net>,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
	kernel-hardening@lists.openwall.com,
	Bruce Fields <bfields@fieldses.org>,
	Kees Cook <keescook@chromium.org>,
	"Reshetova, Elena" <elena.reshetova@intel.com>
Subject: Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session
Date: Tue, 14 Feb 2017 08:48:26 -0500	[thread overview]
Message-ID: <CAEXv5_ifq6gO1eBueYGCL21QBAsCQNZROxGCuEYWSNmXz7OTeQ@mail.gmail.com> (raw)
In-Reply-To: <20170213121238.GA4753@infradead.org>

On Mon, Feb 13, 2017 at 7:12 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Feb 13, 2017 at 06:42:56AM -0500, David Windsor wrote:
>> I'm not sure this is a sound argument for not converting to
>> refcount_t.
>
> It's an argument again the way how this patch was sent.  Please take care
> of all the trivial conversions first, and then do anything non-trivial
> on a case by case basis.

This is actually what we're currently doing.

The vast majority of atomic_t to refcount_t conversions are trivial,
as they most always follow the pattern:

1.  Initialize the atomic_t refcounter to 1.
2.  Perform shared object get/put operations.
3.  Free the shared object when its refcount becomes 0.

We've identified a handful of instances in which steps 1 and 3 are
different from above (i.e. initializing refcounts to 0, freeing
objects when refcount is non-zero, etc.).  The above patch addresses
one of these instances in NFS.

Thanks,
David

WARNING: multiple messages have this Message-ID (diff)
From: David Windsor <dwindsor@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Layton <jlayton@poochiereds.net>,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
	kernel-hardening@lists.openwall.com,
	Bruce Fields <bfields@fieldses.org>,
	Kees Cook <keescook@chromium.org>,
	"Reshetova, Elena" <elena.reshetova@intel.com>
Subject: [kernel-hardening] Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session
Date: Tue, 14 Feb 2017 08:48:26 -0500	[thread overview]
Message-ID: <CAEXv5_ifq6gO1eBueYGCL21QBAsCQNZROxGCuEYWSNmXz7OTeQ@mail.gmail.com> (raw)
In-Reply-To: <20170213121238.GA4753@infradead.org>

On Mon, Feb 13, 2017 at 7:12 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Feb 13, 2017 at 06:42:56AM -0500, David Windsor wrote:
>> I'm not sure this is a sound argument for not converting to
>> refcount_t.
>
> It's an argument again the way how this patch was sent.  Please take care
> of all the trivial conversions first, and then do anything non-trivial
> on a case by case basis.

This is actually what we're currently doing.

The vast majority of atomic_t to refcount_t conversions are trivial,
as they most always follow the pattern:

1.  Initialize the atomic_t refcounter to 1.
2.  Perform shared object get/put operations.
3.  Free the shared object when its refcount becomes 0.

We've identified a handful of instances in which steps 1 and 3 are
different from above (i.e. initializing refcounts to 0, freeing
objects when refcount is non-zero, etc.).  The above patch addresses
one of these instances in NFS.

Thanks,
David

  reply	other threads:[~2017-02-14 13:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09  7:38 [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session David Windsor
2017-02-09  7:38 ` [kernel-hardening] " David Windsor
2017-02-09  7:38 ` David Windsor
2017-02-11  6:42 ` David Windsor
2017-02-11  6:42   ` [kernel-hardening] " David Windsor
     [not found]   ` <CAEXv5_jUa8Av4JABoKSAueiLHSLzibMvaE-8DrVcxZHFceckMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-11 12:31     ` Jeff Layton
2017-02-11 12:31       ` [kernel-hardening] " Jeff Layton
2017-02-11 12:31       ` Jeff Layton
     [not found]       ` <1486816302.4233.29.camel-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
2017-02-11 14:01         ` David Windsor
2017-02-11 14:01           ` [kernel-hardening] " David Windsor
2017-02-11 14:01           ` David Windsor
2017-02-11 14:09           ` Jeff Layton
2017-02-11 14:09             ` [kernel-hardening] " Jeff Layton
     [not found]           ` <CAEXv5_gd7F-eaazzU1BWPzH4huhEcO1Y-FWov5UP9T+6R+fv-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-13 10:38             ` Christoph Hellwig
2017-02-13 10:38               ` [kernel-hardening] " Christoph Hellwig
2017-02-13 10:38               ` Christoph Hellwig
     [not found]               ` <20170213103815.GA5131-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-02-13 11:42                 ` David Windsor
2017-02-13 11:42                   ` [kernel-hardening] " David Windsor
2017-02-13 11:42                   ` David Windsor
     [not found]                   ` <CAEXv5_g=DS4wk0mgZuw-doVCqountb-CxZki1LOoQH-P7W1U4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-13 12:12                     ` Christoph Hellwig
2017-02-13 12:12                       ` [kernel-hardening] " Christoph Hellwig
2017-02-13 12:12                       ` Christoph Hellwig
2017-02-14 13:48                       ` David Windsor [this message]
2017-02-14 13:48                         ` [kernel-hardening] " David Windsor
2017-02-12  1:15         ` Bruce Fields
2017-02-12  1:15           ` [kernel-hardening] " Bruce Fields
2017-02-12  1:15           ` Bruce Fields
2017-02-12  1:42           ` David Windsor
2017-02-12  1:42             ` [kernel-hardening] " David Windsor
2017-02-13 10:54     ` Hans Liljestrand
2017-02-13 10:54       ` Hans Liljestrand
2017-02-13 11:46       ` David Windsor
     [not found]         ` <CAEXv5_hP39k7HSLP-G_khx7MMQHnk=8Z5caa+U5n3bYvUTE1gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-15 16:45           ` Bruce Fields
2017-02-15 16:45             ` Bruce Fields

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=CAEXv5_ifq6gO1eBueYGCL21QBAsCQNZROxGCuEYWSNmXz7OTeQ@mail.gmail.com \
    --to=dwindsor@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=elena.reshetova@intel.com \
    --cc=hch@infradead.org \
    --cc=jlayton@poochiereds.net \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.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 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.