Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 280151 Details for
Bug 254195
use after free in nlm subsystem
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- correctly handle errors from lockd_up (rhel5)
0001-knfsd-Correctly-handle-error-condition-from-lockd_u.patch (text/plain), 3.34 KB, created by
Jeff Layton
on 2007-12-06 19:30:19 UTC
(
hide
)
Description:
patch -- correctly handle errors from lockd_up (rhel5)
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-12-06 19:30:19 UTC
Size:
3.34 KB
patch
obsolete
>From 18d231040d010b2e2cbde6a0dfca0aadf86497c2 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Thu, 6 Dec 2007 13:10:57 -0500 >Subject: [PATCH] knfsd: Correctly handle error condition from lockd_up > >(Backported from upstream commit: 4a3ae42dc312dbdffee803efaf393421b79f997a) > >If lockd_up fails - what should we expect? Do we have to later call >lockd_down? > >Well the nfs client thinks "no", the nfs server thinks "yes". lockd thinks >"yes". > >The only answer that really makes sense is "no" !! > >So: > Make lockd_up only increment nlmsvc_users on success. > Make nfsd handle errors from lockd_up properly. > Make sure lockd_up(0) never fails when lockd is running > so that the 'reclaimer' call to lockd_up doesn't need to > be error checked. > >Cc: "J. Bruce Fields" <bfields@fieldses.org> >Signed-off-by: Neil Brown <neilb@suse.de> >Signed-off-by: Andrew Morton <akpm@osdl.org> >Signed-off-by: Linus Torvalds <torvalds@osdl.org> >--- > fs/lockd/clntlock.c | 2 +- > fs/lockd/svc.c | 12 +++++------- > fs/nfsd/nfssvc.c | 18 +++++++++++------- > 3 files changed, 17 insertions(+), 15 deletions(-) > >diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c >index 52774fe..8955af8 100644 >--- a/fs/lockd/clntlock.c >+++ b/fs/lockd/clntlock.c >@@ -202,7 +202,7 @@ reclaimer(void *ptr) > /* This one ensures that our parent doesn't terminate while the > * reclaim is in progress */ > lock_kernel(); >- lockd_up(); >+ lockd_up(); /* note: this cannot fail as lockd is already running */ > > nlmclnt_prepare_reclaim(host); > /* First, reclaim all locks that have been marked. */ >diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c >index e19f096..151777f 100644 >--- a/fs/lockd/svc.c >+++ b/fs/lockd/svc.c >@@ -255,15 +255,11 @@ lockd_up_proto(int proto) > > mutex_lock(&nlmsvc_mutex); > /* >- * Unconditionally increment the user count ... this is >- * the number of clients who _want_ a lockd process. >- */ >- nlmsvc_users++; >- /* > * Check whether we're already up and running. > */ > if (nlmsvc_pid) { >- error = make_socks(nlmsvc_serv, proto); >+ if (proto) >+ error = make_socks(nlmsvc_serv, proto); > goto out; > } > >@@ -271,7 +267,7 @@ lockd_up_proto(int proto) > * Sanity check: if there's no pid, > * we should be the first user ... > */ >- if (nlmsvc_users > 1) >+ if (nlmsvc_users) > printk(KERN_WARNING > "lockd_up: no pid, %d users??\n", nlmsvc_users); > >@@ -308,6 +304,8 @@ lockd_up_proto(int proto) > destroy_and_out: > svc_destroy(serv); > out: >+ if (!error) >+ nlmsvc_users++; > mutex_unlock(&nlmsvc_mutex); > return error; > } >diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c >index 7872bba..42f478c 100644 >--- a/fs/nfsd/nfssvc.c >+++ b/fs/nfsd/nfssvc.c >@@ -229,18 +229,22 @@ static int nfsd_init_socks(int port) > if (!list_empty(&nfsd_serv->sv_permsocks)) > return 0; > >- error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); >- if (error < 0) >- return error; > error = lockd_up_proto(IPPROTO_UDP); >- if (error < 0) >+ if (error >= 0) { >+ error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); >+ if (error < 0) >+ lockd_down(); >+ } >+ if (error < 0) > return error; > > #ifdef CONFIG_NFSD_TCP >- error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); >- if (error < 0) >- return error; > error = lockd_up_proto(IPPROTO_TCP); >+ if (error >= 0) { >+ error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); >+ if (error < 0) >+ lockd_down(); >+ } > if (error < 0) > return error; > #endif >-- >1.5.3.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254195
:
277081
|
278361
|
280141
|
280151
|
280161
|
306390
|
306391
|
306392