Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
301f0268
Commit
301f0268
authored
Sep 01, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd: racy access to ->d_name in nsfd4_encode_path()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ca4e0519
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+8
-6
No files found.
fs/nfsd/nfs4xdr.c
View file @
301f0268
...
...
@@ -1816,10 +1816,7 @@ static __be32 nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
static
__be32
nfsd4_encode_path
(
const
struct
path
*
root
,
const
struct
path
*
path
,
__be32
**
pp
,
int
*
buflen
)
{
struct
path
cur
=
{
.
mnt
=
path
->
mnt
,
.
dentry
=
path
->
dentry
,
};
struct
path
cur
=
*
path
;
__be32
*
p
=
*
pp
;
struct
dentry
**
components
=
NULL
;
unsigned
int
ncomponents
=
0
;
...
...
@@ -1859,14 +1856,19 @@ static __be32 nfsd4_encode_path(const struct path *root,
while
(
ncomponents
)
{
struct
dentry
*
dentry
=
components
[
ncomponents
-
1
];
unsigned
int
len
=
dentry
->
d_name
.
len
;
unsigned
int
len
;
spin_lock
(
&
dentry
->
d_lock
);
len
=
dentry
->
d_name
.
len
;
*
buflen
-=
4
+
(
XDR_QUADLEN
(
len
)
<<
2
);
if
(
*
buflen
<
0
)
if
(
*
buflen
<
0
)
{
spin_unlock
(
&
dentry
->
d_lock
);
goto
out_free
;
}
WRITE32
(
len
);
WRITEMEM
(
dentry
->
d_name
.
name
,
len
);
dprintk
(
"/%s"
,
dentry
->
d_name
.
name
);
spin_unlock
(
&
dentry
->
d_lock
);
dput
(
dentry
);
ncomponents
--
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment