Re: [kernel-hardening] Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-15 Thread Bruce Fields
On Mon, Feb 13, 2017 at 06:46:19AM -0500, David Windsor wrote: > On Mon, Feb 13, 2017 at 5:54 AM, Hans Liljestrand wrote: > > On Sat, Feb 11, 2017 at 01:42:53AM -0500, David Windsor wrote: > >> > >> > >> > >>> Signed-off-by: David Windsor > >>> --- > >>> fs/nfsd/nfs4state.c | 6 +++--- > >>> 1

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-14 Thread David Windsor
On Mon, Feb 13, 2017 at 7:12 AM, Christoph Hellwig 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 trivia

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-13 Thread Christoph Hellwig
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 c

Re: [kernel-hardening] Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-13 Thread David Windsor
On Mon, Feb 13, 2017 at 5:54 AM, Hans Liljestrand wrote: > On Sat, Feb 11, 2017 at 01:42:53AM -0500, David Windsor wrote: >> >> >> >>> Signed-off-by: David Windsor >>> --- >>> fs/nfsd/nfs4state.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/fs/nfsd/nfs4st

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-13 Thread David Windsor
On Mon, Feb 13, 2017 at 5:38 AM, Christoph Hellwig wrote: > On Sat, Feb 11, 2017 at 09:01:15AM -0500, David Windsor wrote: >> I'm not sure there's another way to accomplish what we need >> (initializing struct nfsd4_session objects with refcount=1) without >> also modifying the freeable reference

Re: [kernel-hardening] Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-13 Thread Hans Liljestrand
On Sat, Feb 11, 2017 at 01:42:53AM -0500, David Windsor wrote: Signed-off-by: David Windsor --- fs/nfsd/nfs4state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a0dee8a..b0f3010 100644 --- a/fs/nfsd/nfs4state.c +++

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-13 Thread Christoph Hellwig
On Sat, Feb 11, 2017 at 09:01:15AM -0500, David Windsor wrote: > I'm not sure there's another way to accomplish what we need > (initializing struct nfsd4_session objects with refcount=1) without > also modifying the freeable reference state. After migrating to the > refcount_t API, if we leave ini

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-11 Thread David Windsor
On Sat, Feb 11, 2017 at 8:15 PM, Bruce Fields wrote: > On Sat, Feb 11, 2017 at 07:31:42AM -0500, Jeff Layton wrote: >> The basic idea here is that nfsv4 sessions have a "resting state" of 0. >> We want to keep them around, but if they go "dead" then we we'll tear >> them down if they aren't active

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-11 Thread Bruce Fields
On Sat, Feb 11, 2017 at 07:31:42AM -0500, Jeff Layton wrote: > The basic idea here is that nfsv4 sessions have a "resting state" of 0. > We want to keep them around, but if they go "dead" then we we'll tear > them down if they aren't actively in use at the time. So, we still free > the thing when t

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-11 Thread Jeff Layton
On Sat, 2017-02-11 at 09:01 -0500, David Windsor wrote: > On Sat, Feb 11, 2017 at 7:31 AM, Jeff Layton wrote: > > On Sat, 2017-02-11 at 01:42 -0500, David Windsor wrote: > > > > > > > > > > Signed-off-by: David Windsor > > > > --- > > > > fs/nfsd/nfs4state.c | 6 +++--- > > > > 1 file changed,

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-11 Thread David Windsor
On Sat, Feb 11, 2017 at 7:31 AM, Jeff Layton wrote: > On Sat, 2017-02-11 at 01:42 -0500, David Windsor wrote: >> >> >> > Signed-off-by: David Windsor >> > --- >> > fs/nfsd/nfs4state.c | 6 +++--- >> > 1 file changed, 3 insertions(+), 3 deletions(-) >> > >> > diff --git a/fs/nfsd/nfs4state.c b/f

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-11 Thread Jeff Layton
On Sat, 2017-02-11 at 01:42 -0500, David Windsor wrote: > > > > Signed-off-by: David Windsor > > --- > > fs/nfsd/nfs4state.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > > index a0dee8a..b0f3010 100644 > > ---

Re: [RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-10 Thread David Windsor
> Signed-off-by: David Windsor > --- > fs/nfsd/nfs4state.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index a0dee8a..b0f3010 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -196,7 +196,7 @@ stati

[RFC][PATCH] nfsd: add +1 to reference counting scheme for struct nfsd4_session

2017-02-10 Thread David Windsor
In furtherance of the KSPP effort to add overflow protection to kernel reference counters, a new type (refcount_t) and API have been created. Part of the refcount_t API is refcount_inc(), which will not increment a refcount_t variable if its value is 0 (as this would indicate a possible use-after-f