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
nexedi
linux
Commits
ed382d58
Commit
ed382d58
authored
Sep 05, 2008
by
Adrian Hunter
Committed by
Artem Bityutskiy
Sep 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UBIFS: ensure data read beyond i_size is zeroed out correctly
Signed-off-by:
Adrian Hunter
<
ext-adrian.hunter@nokia.com
>
parent
2094c334
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
fs/ubifs/file.c
fs/ubifs/file.c
+8
-2
fs/ubifs/ubifs-media.h
fs/ubifs/ubifs-media.h
+0
-1
No files found.
fs/ubifs/file.c
View file @
ed382d58
...
...
@@ -147,6 +147,12 @@ static int do_readpage(struct page *page)
err
=
ret
;
if
(
err
!=
-
ENOENT
)
break
;
}
else
if
(
block
+
1
==
beyond
)
{
int
dlen
=
le32_to_cpu
(
dn
->
size
);
int
ilen
=
i_size
&
(
UBIFS_BLOCK_SIZE
-
1
);
if
(
ilen
&&
ilen
<
dlen
)
memset
(
addr
+
ilen
,
0
,
dlen
-
ilen
);
}
}
if
(
++
i
>=
UBIFS_BLOCKS_PER_PAGE
)
...
...
@@ -601,7 +607,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,
addr
=
zaddr
=
kmap
(
page
);
end_index
=
(
i_size
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
end_index
=
(
i_size
-
1
)
>>
PAGE_CACHE_SHIFT
;
if
(
!
i_size
||
page
->
index
>
end_index
)
{
memset
(
addr
,
0
,
PAGE_CACHE_SIZE
);
goto
out_hole
;
...
...
@@ -649,7 +655,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,
if
(
end_index
==
page
->
index
)
{
int
len
=
i_size
&
(
PAGE_CACHE_SIZE
-
1
);
if
(
len
<
read
)
if
(
len
&&
len
<
read
)
memset
(
zaddr
+
len
,
0
,
read
-
len
);
}
...
...
fs/ubifs/ubifs-media.h
View file @
ed382d58
...
...
@@ -75,7 +75,6 @@
*/
#define UBIFS_BLOCK_SIZE 4096
#define UBIFS_BLOCK_SHIFT 12
#define UBIFS_BLOCK_MASK 0x00000FFF
/* UBIFS padding byte pattern (must not be first or last byte of node magic) */
#define UBIFS_PADDING_BYTE 0xCE
...
...
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