diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:06 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:06 -0500 |
commit | 7bab377fcb495ee2e5a1cd69d235f8d84c76e3af (patch) | |
tree | 67f03fbc543632ccf71075af250635201b43801b /fs/lockd/clntproc.c | |
parent | 36943fa4b2701b9ef2d60084c85ecbe634aec252 (diff) |
lockd: Don't expose the process pid to the NLM server
Instead we use the nlm_lockowner->pid.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r-- | fs/lockd/clntproc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 615a988a92a7..acc3eb13a02b 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -132,8 +132,10 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) | |||
132 | memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh)); | 132 | memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh)); |
133 | lock->caller = system_utsname.nodename; | 133 | lock->caller = system_utsname.nodename; |
134 | lock->oh.data = req->a_owner; | 134 | lock->oh.data = req->a_owner; |
135 | lock->oh.len = sprintf(req->a_owner, "%d@%s", | 135 | lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", |
136 | current->pid, system_utsname.nodename); | 136 | (unsigned int)fl->fl_u.nfs_fl.owner->pid, |
137 | system_utsname.nodename); | ||
138 | lock->svid = fl->fl_u.nfs_fl.owner->pid; | ||
137 | locks_copy_lock(&lock->fl, fl); | 139 | locks_copy_lock(&lock->fl, fl); |
138 | } | 140 | } |
139 | 141 | ||
@@ -159,6 +161,7 @@ nlmclnt_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock) | |||
159 | 161 | ||
160 | /* set default data area */ | 162 | /* set default data area */ |
161 | call->a_args.lock.oh.data = call->a_owner; | 163 | call->a_args.lock.oh.data = call->a_owner; |
164 | call->a_args.lock.svid = lock->fl.fl_pid; | ||
162 | 165 | ||
163 | if (lock->oh.len > NLMCLNT_OHSIZE) { | 166 | if (lock->oh.len > NLMCLNT_OHSIZE) { |
164 | void *data = kmalloc(lock->oh.len, GFP_KERNEL); | 167 | void *data = kmalloc(lock->oh.len, GFP_KERNEL); |