Skip to content

Commit

Permalink
nfsd: fix auth_domain reference leak on nlm operations
Browse files Browse the repository at this point in the history
commit 954032d upstream.

This was noticed by users who performed more than 2^32 lock operations
and hence made this counter overflow (eventually leading to
use-after-free's).  Setting rq_client to NULL here means that it won't
later get auth_domain_put() when it should be.

Appears to have been introduced in 2.5.42 by "[PATCH] kNFSd: Move auth
domain lookup into svcauth" which moved most of the rq_client handling
to common svcauth code, but left behind this one line.

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
J. Bruce Fields authored and Greg Kroah-Hartman committed Apr 14, 2011
1 parent 6fc45e2 commit 39932bd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/nfsd/lockd.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)
exp_readlock();
nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp);
fh_put(&fh);
rqstp->rq_client = NULL;
exp_readunlock();
/* We return nlm error codes as nlm doesn't know
* about nfsd, but nfsd does know about nlm..
Expand Down

0 comments on commit 39932bd

Please sign in to comment.