Skip to content

Commit

Permalink
Fix memory corruption caused by nfsd readdir+
Browse files Browse the repository at this point in the history
Commit 8177e6d ("nfsd: clean up
readdirplus encoding") introduced single character typo in nfs3 readdir+
implementation.  Unfortunately that typo has quite bad side effects:
random memory corruption, followed (on my box) with immediate
spontaneous box reboot.

Using 'p1' instead of 'p' fixes my Linux box rebooting whenever VMware
ESXi box tries to list contents of my home directory.

Signed-off-by: Petr Vandrovec <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Cc: Neil Brown <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
petrvandrovec authored and torvalds committed Nov 14, 2009
1 parent 156171c commit 479c255
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs3xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, int namlen,
p1 = encode_entry_baggage(cd, p1, name, namlen, ino);

if (plus)
p = encode_entryplus_baggage(cd, p1, name, namlen);
p1 = encode_entryplus_baggage(cd, p1, name, namlen);

/* determine entry word length and lengths to go in pages */
num_entry_words = p1 - tmp;
Expand Down

0 comments on commit 479c255

Please sign in to comment.