Skip to content

Commit 7a0e404

Browse files
Russell KingAl Viro
authored andcommitted
fs/adfs: newdir: improve directory validation
Check that the lastmask and reserved fields are all zero, as per the documentation. Signed-off-by: Russell King <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent ffc8df3 commit 7a0e404

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/adfs/dir_f.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static int adfs_f_validate(struct adfs_dir *dir)
127127
struct adfs_newdirtail *tail = dir->newtail;
128128

129129
if (head->startmasseq != tail->endmasseq ||
130+
tail->dirlastmask || tail->reserved[0] || tail->reserved[1] ||
130131
(memcmp(&head->startname, "Nick", 4) &&
131132
memcmp(&head->startname, "Hugo", 4)) ||
132133
memcmp(&head->startname, &tail->endname, 4) ||

0 commit comments

Comments
 (0)