Skip to content

Commit f4f61d2

Browse files
ubifs: Implement encrypted filenames
Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: David Gstir <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent b9bc8c7 commit f4f61d2

File tree

8 files changed

+414
-197
lines changed

8 files changed

+414
-197
lines changed

fs/ubifs/debug.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static void dump_ch(const struct ubifs_ch *ch)
233233
void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode)
234234
{
235235
const struct ubifs_inode *ui = ubifs_inode(inode);
236-
struct qstr nm = { .name = NULL };
236+
struct fscrypt_name nm = {0};
237237
union ubifs_key key;
238238
struct ubifs_dent_node *dent, *pdent = NULL;
239239
int count = 2;
@@ -289,8 +289,8 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode)
289289
pr_err("\t%d: %s (%s)\n",
290290
count++, dent->name, get_dent_type(dent->type));
291291

292-
nm.name = dent->name;
293-
nm.len = le16_to_cpu(dent->nlen);
292+
fname_name(&nm) = dent->name;
293+
fname_len(&nm) = le16_to_cpu(dent->nlen);
294294
kfree(pdent);
295295
pdent = dent;
296296
key_read(c, &dent->key, &key);
@@ -1107,7 +1107,7 @@ int dbg_check_dir(struct ubifs_info *c, const struct inode *dir)
11071107
unsigned int nlink = 2;
11081108
union ubifs_key key;
11091109
struct ubifs_dent_node *dent, *pdent = NULL;
1110-
struct qstr nm = { .name = NULL };
1110+
struct fscrypt_name nm = {0};
11111111
loff_t size = UBIFS_INO_NODE_SZ;
11121112

11131113
if (!dbg_is_chk_gen(c))
@@ -1128,9 +1128,9 @@ int dbg_check_dir(struct ubifs_info *c, const struct inode *dir)
11281128
return err;
11291129
}
11301130

1131-
nm.name = dent->name;
1132-
nm.len = le16_to_cpu(dent->nlen);
1133-
size += CALC_DENT_SIZE(nm.len);
1131+
fname_name(&nm) = dent->name;
1132+
fname_len(&nm) = le16_to_cpu(dent->nlen);
1133+
size += CALC_DENT_SIZE(fname_len(&nm));
11341134
if (dent->type == UBIFS_ITYPE_DIR)
11351135
nlink += 1;
11361136
kfree(pdent);

0 commit comments

Comments
 (0)