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
cc41a536
Commit
cc41a536
authored
Oct 16, 2016
by
Richard Weinberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ubifs: Use a random number for cookies
Signed-off-by:
Richard Weinberger
<
richard@nod.at
>
parent
528e3d17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
fs/ubifs/journal.c
fs/ubifs/journal.c
+3
-0
fs/ubifs/ubifs.h
fs/ubifs/ubifs.h
+1
-0
No files found.
fs/ubifs/journal.c
View file @
cc41a536
...
@@ -589,6 +589,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
...
@@ -589,6 +589,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
dent
->
nlen
=
cpu_to_le16
(
fname_len
(
nm
));
dent
->
nlen
=
cpu_to_le16
(
fname_len
(
nm
));
memcpy
(
dent
->
name
,
fname_name
(
nm
),
fname_len
(
nm
));
memcpy
(
dent
->
name
,
fname_name
(
nm
),
fname_len
(
nm
));
dent
->
name
[
fname_len
(
nm
)]
=
'\0'
;
dent
->
name
[
fname_len
(
nm
)]
=
'\0'
;
dent
->
cookie
=
prandom_u32
();
zero_dent_node_unused
(
dent
);
zero_dent_node_unused
(
dent
);
ubifs_prep_grp_node
(
c
,
dent
,
dlen
,
0
);
ubifs_prep_grp_node
(
c
,
dent
,
dlen
,
0
);
...
@@ -1124,6 +1125,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
...
@@ -1124,6 +1125,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
dent
->
nlen
=
cpu_to_le16
(
fname_len
(
new_nm
));
dent
->
nlen
=
cpu_to_le16
(
fname_len
(
new_nm
));
memcpy
(
dent
->
name
,
fname_name
(
new_nm
),
fname_len
(
new_nm
));
memcpy
(
dent
->
name
,
fname_name
(
new_nm
),
fname_len
(
new_nm
));
dent
->
name
[
fname_len
(
new_nm
)]
=
'\0'
;
dent
->
name
[
fname_len
(
new_nm
)]
=
'\0'
;
dent
->
cookie
=
prandom_u32
();
zero_dent_node_unused
(
dent
);
zero_dent_node_unused
(
dent
);
ubifs_prep_grp_node
(
c
,
dent
,
dlen1
,
0
);
ubifs_prep_grp_node
(
c
,
dent
,
dlen1
,
0
);
...
@@ -1142,6 +1144,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
...
@@ -1142,6 +1144,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
dent2
->
nlen
=
cpu_to_le16
(
fname_len
(
old_nm
));
dent2
->
nlen
=
cpu_to_le16
(
fname_len
(
old_nm
));
memcpy
(
dent2
->
name
,
fname_name
(
old_nm
),
fname_len
(
old_nm
));
memcpy
(
dent2
->
name
,
fname_name
(
old_nm
),
fname_len
(
old_nm
));
dent2
->
name
[
fname_len
(
old_nm
)]
=
'\0'
;
dent2
->
name
[
fname_len
(
old_nm
)]
=
'\0'
;
dent2
->
cookie
=
prandom_u32
();
zero_dent_node_unused
(
dent2
);
zero_dent_node_unused
(
dent2
);
ubifs_prep_grp_node
(
c
,
dent2
,
dlen2
,
0
);
ubifs_prep_grp_node
(
c
,
dent2
,
dlen2
,
0
);
...
...
fs/ubifs/ubifs.h
View file @
cc41a536
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <linux/security.h>
#include <linux/security.h>
#include <linux/xattr.h>
#include <linux/xattr.h>
#include <linux/fscrypto.h>
#include <linux/fscrypto.h>
#include <linux/random.h>
#include "ubifs-media.h"
#include "ubifs-media.h"
/* Version of this UBIFS implementation */
/* Version of this UBIFS implementation */
...
...
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