fix devtmpfs race
After we's done complete(&req->done), there's nothing to prevent the scope containing *req from being gone and *req overwritten by any kind of junk. So we must read req->next before that... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
eda65cc6ce
commit
e13889bab3
1 changed files with 2 additions and 1 deletions
|
@ -406,9 +406,10 @@ static int devtmpfsd(void *p)
|
||||||
requests = NULL;
|
requests = NULL;
|
||||||
spin_unlock(&req_lock);
|
spin_unlock(&req_lock);
|
||||||
while (req) {
|
while (req) {
|
||||||
|
struct req *next = req->next;
|
||||||
req->err = handle(req->name, req->mode, req->dev);
|
req->err = handle(req->name, req->mode, req->dev);
|
||||||
complete(&req->done);
|
complete(&req->done);
|
||||||
req = req->next;
|
req = next;
|
||||||
}
|
}
|
||||||
spin_lock(&req_lock);
|
spin_lock(&req_lock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue