blob: 217d4219b3865101b006759b8e49185d72dabb30 [file] [log] [blame]
Jaegeuk Kim0b81d072015-05-15 16:26:10 -07001/*
2 * This contains functions for filename crypto management
3 *
4 * Copyright (C) 2015, Google, Inc.
5 * Copyright (C) 2015, Motorola Mobility
6 *
7 * Written by Uday Savagaonkar, 2014.
8 * Modified by Jaegeuk Kim, 2015.
9 *
10 * This has not yet undergone a rigorous security audit.
11 */
12
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070013#include <linux/scatterlist.h>
14#include <linux/ratelimit.h>
Eric Biggerseb9c5fd2018-01-05 10:45:00 -080015#include <crypto/skcipher.h>
Jaegeuk Kime6b120d2017-07-10 12:55:09 -070016#include "fscrypt_private.h"
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070017
Eric Biggers0a024722018-01-05 10:44:59 -080018static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
19{
20 if (str->len == 1 && str->name[0] == '.')
21 return true;
22
23 if (str->len == 2 && str->name[0] == '.' && str->name[1] == '.')
24 return true;
25
26 return false;
27}
28
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070029/**
Eric Biggersef1eb3a2016-09-15 17:25:55 -040030 * fname_encrypt() - encrypt a filename
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070031 *
Eric Biggersb0edc2f2018-01-11 23:30:08 -050032 * The output buffer must be at least as large as the input buffer.
33 * Any extra space is filled with NUL padding before encryption.
Eric Biggersef1eb3a2016-09-15 17:25:55 -040034 *
35 * Return: 0 on success, -errno on failure
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070036 */
Eric Biggersb0edc2f2018-01-11 23:30:08 -050037int fname_encrypt(struct inode *inode, const struct qstr *iname,
38 u8 *out, unsigned int olen)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070039{
Linus Torvaldsd4075742016-03-21 11:03:02 -070040 struct skcipher_request *req = NULL;
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +010041 DECLARE_CRYPTO_WAIT(wait);
Eric Biggerse33fa312018-11-26 11:27:37 -080042 struct fscrypt_info *ci = inode->i_crypt_info;
43 struct crypto_skcipher *tfm = ci->ci_ctfm;
44 union fscrypt_iv iv;
Eric Biggers3c7018e2016-11-13 20:35:52 -050045 struct scatterlist sg;
Eric Biggerse33fa312018-11-26 11:27:37 -080046 int res;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070047
Eric Biggers3c7018e2016-11-13 20:35:52 -050048 /*
49 * Copy the filename to the output buffer for encrypting in-place and
50 * pad it with the needed number of NUL bytes.
51 */
Eric Biggersb0edc2f2018-01-11 23:30:08 -050052 if (WARN_ON(olen < iname->len))
Eric Biggersa7e05c72018-01-05 10:45:01 -080053 return -ENOBUFS;
Eric Biggersb0edc2f2018-01-11 23:30:08 -050054 memcpy(out, iname->name, iname->len);
55 memset(out + iname->len, 0, olen - iname->len);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070056
Eric Biggers3c7018e2016-11-13 20:35:52 -050057 /* Initialize the IV */
Eric Biggerse33fa312018-11-26 11:27:37 -080058 fscrypt_generate_iv(&iv, 0, ci);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070059
Eric Biggers3c7018e2016-11-13 20:35:52 -050060 /* Set up the encryption request */
Linus Torvaldsd4075742016-03-21 11:03:02 -070061 req = skcipher_request_alloc(tfm, GFP_NOFS);
Eric Biggers1e04ac82018-04-30 15:51:38 -070062 if (!req)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070063 return -ENOMEM;
Linus Torvaldsd4075742016-03-21 11:03:02 -070064 skcipher_request_set_callback(req,
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070065 CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +010066 crypto_req_done, &wait);
Eric Biggersb0edc2f2018-01-11 23:30:08 -050067 sg_init_one(&sg, out, olen);
Eric Biggerse33fa312018-11-26 11:27:37 -080068 skcipher_request_set_crypt(req, &sg, &sg, olen, &iv);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070069
Eric Biggers3c7018e2016-11-13 20:35:52 -050070 /* Do the encryption */
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +010071 res = crypto_wait_req(crypto_skcipher_encrypt(req), &wait);
Linus Torvaldsd4075742016-03-21 11:03:02 -070072 skcipher_request_free(req);
Eric Biggersef1eb3a2016-09-15 17:25:55 -040073 if (res < 0) {
Eric Biggers78275d82018-04-30 15:51:47 -070074 fscrypt_err(inode->i_sb,
75 "Filename encryption failed for inode %lu: %d",
76 inode->i_ino, res);
Eric Biggersef1eb3a2016-09-15 17:25:55 -040077 return res;
78 }
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070079
Eric Biggersef1eb3a2016-09-15 17:25:55 -040080 return 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070081}
82
Eric Biggersef1eb3a2016-09-15 17:25:55 -040083/**
84 * fname_decrypt() - decrypt a filename
85 *
86 * The caller must have allocated sufficient memory for the @oname string.
87 *
88 * Return: 0 on success, -errno on failure
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070089 */
90static int fname_decrypt(struct inode *inode,
91 const struct fscrypt_str *iname,
92 struct fscrypt_str *oname)
93{
Linus Torvaldsd4075742016-03-21 11:03:02 -070094 struct skcipher_request *req = NULL;
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +010095 DECLARE_CRYPTO_WAIT(wait);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -070096 struct scatterlist src_sg, dst_sg;
Eric Biggerse33fa312018-11-26 11:27:37 -080097 struct fscrypt_info *ci = inode->i_crypt_info;
98 struct crypto_skcipher *tfm = ci->ci_ctfm;
99 union fscrypt_iv iv;
100 int res;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700101
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700102 /* Allocate request */
Linus Torvaldsd4075742016-03-21 11:03:02 -0700103 req = skcipher_request_alloc(tfm, GFP_NOFS);
Eric Biggers1e04ac82018-04-30 15:51:38 -0700104 if (!req)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700105 return -ENOMEM;
Linus Torvaldsd4075742016-03-21 11:03:02 -0700106 skcipher_request_set_callback(req,
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700107 CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +0100108 crypto_req_done, &wait);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700109
110 /* Initialize IV */
Eric Biggerse33fa312018-11-26 11:27:37 -0800111 fscrypt_generate_iv(&iv, 0, ci);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700112
113 /* Create decryption request */
114 sg_init_one(&src_sg, iname->name, iname->len);
115 sg_init_one(&dst_sg, oname->name, oname->len);
Eric Biggerse33fa312018-11-26 11:27:37 -0800116 skcipher_request_set_crypt(req, &src_sg, &dst_sg, iname->len, &iv);
Gilad Ben-Yossef743205f2017-10-18 08:00:44 +0100117 res = crypto_wait_req(crypto_skcipher_decrypt(req), &wait);
Linus Torvaldsd4075742016-03-21 11:03:02 -0700118 skcipher_request_free(req);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700119 if (res < 0) {
Eric Biggers78275d82018-04-30 15:51:47 -0700120 fscrypt_err(inode->i_sb,
121 "Filename decryption failed for inode %lu: %d",
122 inode->i_ino, res);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700123 return res;
124 }
125
126 oname->len = strnlen(oname->name, iname->len);
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400127 return 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700128}
129
130static const char *lookup_table =
131 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
132
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700133#define BASE64_CHARS(nbytes) DIV_ROUND_UP((nbytes) * 4, 3)
134
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700135/**
136 * digest_encode() -
137 *
138 * Encodes the input digest using characters from the set [a-zA-Z0-9_+].
139 * The encoded string is roughly 4/3 times the size of the input string.
140 */
141static int digest_encode(const char *src, int len, char *dst)
142{
143 int i = 0, bits = 0, ac = 0;
144 char *cp = dst;
145
146 while (i < len) {
147 ac += (((unsigned char) src[i]) << bits);
148 bits += 8;
149 do {
150 *cp++ = lookup_table[ac & 0x3f];
151 ac >>= 6;
152 bits -= 6;
153 } while (bits >= 6);
154 i++;
155 }
156 if (bits)
157 *cp++ = lookup_table[ac & 0x3f];
158 return cp - dst;
159}
160
161static int digest_decode(const char *src, int len, char *dst)
162{
163 int i = 0, bits = 0, ac = 0;
164 const char *p;
165 char *cp = dst;
166
167 while (i < len) {
168 p = strchr(lookup_table, src[i]);
169 if (p == NULL || src[i] == 0)
170 return -2;
171 ac += (p - lookup_table) << bits;
172 bits += 6;
173 if (bits >= 8) {
174 *cp++ = ac & 0xff;
175 ac >>= 8;
176 bits -= 8;
177 }
178 i++;
179 }
180 if (ac)
181 return -1;
182 return cp - dst;
183}
184
Eric Biggers549b2062018-01-11 23:30:08 -0500185bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
186 u32 max_len, u32 *encrypted_len_ret)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700187{
Eric Biggers549b2062018-01-11 23:30:08 -0500188 int padding = 4 << (inode->i_crypt_info->ci_flags &
189 FS_POLICY_FLAGS_PAD_MASK);
190 u32 encrypted_len;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700191
Eric Biggers549b2062018-01-11 23:30:08 -0500192 if (orig_len > max_len)
193 return false;
194 encrypted_len = max(orig_len, (u32)FS_CRYPTO_BLOCK_SIZE);
195 encrypted_len = round_up(encrypted_len, padding);
196 *encrypted_len_ret = min(encrypted_len, max_len);
197 return true;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700198}
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700199
200/**
Eric Biggersc440b5092018-01-11 23:30:08 -0500201 * fscrypt_fname_alloc_buffer - allocate a buffer for presented filenames
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700202 *
Eric Biggersc440b5092018-01-11 23:30:08 -0500203 * Allocate a buffer that is large enough to hold any decrypted or encoded
204 * filename (null-terminated), for the given maximum encrypted filename length.
205 *
206 * Return: 0 on success, -errno on failure
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700207 */
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700208int fscrypt_fname_alloc_buffer(const struct inode *inode,
Eric Biggersc440b5092018-01-11 23:30:08 -0500209 u32 max_encrypted_len,
210 struct fscrypt_str *crypto_str)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700211{
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700212 const u32 max_encoded_len =
213 max_t(u32, BASE64_CHARS(FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE),
214 1 + BASE64_CHARS(sizeof(struct fscrypt_digested_name)));
Eric Biggersc440b5092018-01-11 23:30:08 -0500215 u32 max_presented_len;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700216
Eric Biggersc440b5092018-01-11 23:30:08 -0500217 max_presented_len = max(max_encoded_len, max_encrypted_len);
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700218
Eric Biggersc440b5092018-01-11 23:30:08 -0500219 crypto_str->name = kmalloc(max_presented_len + 1, GFP_NOFS);
220 if (!crypto_str->name)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700221 return -ENOMEM;
Eric Biggersc440b5092018-01-11 23:30:08 -0500222 crypto_str->len = max_presented_len;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700223 return 0;
224}
225EXPORT_SYMBOL(fscrypt_fname_alloc_buffer);
226
227/**
Eric Biggersc440b5092018-01-11 23:30:08 -0500228 * fscrypt_fname_free_buffer - free the buffer for presented filenames
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700229 *
Eric Biggersc440b5092018-01-11 23:30:08 -0500230 * Free the buffer allocated by fscrypt_fname_alloc_buffer().
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700231 */
232void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str)
233{
234 if (!crypto_str)
235 return;
236 kfree(crypto_str->name);
237 crypto_str->name = NULL;
238}
239EXPORT_SYMBOL(fscrypt_fname_free_buffer);
240
241/**
242 * fscrypt_fname_disk_to_usr() - converts a filename from disk space to user
243 * space
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400244 *
245 * The caller must have allocated sufficient memory for the @oname string.
246 *
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700247 * If the key is available, we'll decrypt the disk name; otherwise, we'll encode
248 * it for presentation. Short names are directly base64-encoded, while long
249 * names are encoded in fscrypt_digested_name format.
250 *
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400251 * Return: 0 on success, -errno on failure
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700252 */
253int fscrypt_fname_disk_to_usr(struct inode *inode,
254 u32 hash, u32 minor_hash,
255 const struct fscrypt_str *iname,
256 struct fscrypt_str *oname)
257{
258 const struct qstr qname = FSTR_TO_QSTR(iname);
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700259 struct fscrypt_digested_name digested_name;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700260
261 if (fscrypt_is_dot_dotdot(&qname)) {
262 oname->name[0] = '.';
263 oname->name[iname->len - 1] = '.';
264 oname->len = iname->len;
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400265 return 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700266 }
267
268 if (iname->len < FS_CRYPTO_BLOCK_SIZE)
269 return -EUCLEAN;
270
271 if (inode->i_crypt_info)
272 return fname_decrypt(inode, iname, oname);
273
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700274 if (iname->len <= FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE) {
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400275 oname->len = digest_encode(iname->name, iname->len,
276 oname->name);
277 return 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700278 }
279 if (hash) {
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700280 digested_name.hash = hash;
281 digested_name.minor_hash = minor_hash;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700282 } else {
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700283 digested_name.hash = 0;
284 digested_name.minor_hash = 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700285 }
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700286 memcpy(digested_name.digest,
287 FSCRYPT_FNAME_DIGEST(iname->name, iname->len),
288 FSCRYPT_FNAME_DIGEST_SIZE);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700289 oname->name[0] = '_';
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700290 oname->len = 1 + digest_encode((const char *)&digested_name,
291 sizeof(digested_name), oname->name + 1);
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400292 return 0;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700293}
294EXPORT_SYMBOL(fscrypt_fname_disk_to_usr);
295
296/**
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700297 * fscrypt_setup_filename() - prepare to search a possibly encrypted directory
298 * @dir: the directory that will be searched
299 * @iname: the user-provided filename being searched for
300 * @lookup: 1 if we're allowed to proceed without the key because it's
301 * ->lookup() or we're finding the dir_entry for deletion; 0 if we cannot
302 * proceed without the key because we're going to create the dir_entry.
303 * @fname: the filename information to be filled in
304 *
305 * Given a user-provided filename @iname, this function sets @fname->disk_name
306 * to the name that would be stored in the on-disk directory entry, if possible.
307 * If the directory is unencrypted this is simply @iname. Else, if we have the
308 * directory's encryption key, then @iname is the plaintext, so we encrypt it to
309 * get the disk_name.
310 *
311 * Else, for keyless @lookup operations, @iname is the presented ciphertext, so
312 * we decode it to get either the ciphertext disk_name (for short names) or the
313 * fscrypt_digested_name (for long names). Non-@lookup operations will be
314 * impossible in this case, so we fail them with ENOKEY.
315 *
316 * If successful, fscrypt_free_filename() must be called later to clean up.
317 *
318 * Return: 0 on success, -errno on failure
319 */
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700320int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,
321 int lookup, struct fscrypt_name *fname)
322{
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700323 int ret;
324 int digested;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700325
326 memset(fname, 0, sizeof(struct fscrypt_name));
327 fname->usr_fname = iname;
328
Eric Biggersd750ec72017-10-09 12:15:36 -0700329 if (!IS_ENCRYPTED(dir) || fscrypt_is_dot_dotdot(iname)) {
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700330 fname->disk_name.name = (unsigned char *)iname->name;
331 fname->disk_name.len = iname->len;
332 return 0;
333 }
Eric Biggers2984e522017-02-21 15:07:11 -0800334 ret = fscrypt_get_encryption_info(dir);
Eric Biggersd3679392018-04-30 15:51:41 -0700335 if (ret)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700336 return ret;
337
338 if (dir->i_crypt_info) {
Eric Biggers549b2062018-01-11 23:30:08 -0500339 if (!fscrypt_fname_encrypted_size(dir, iname->len,
Eric Biggers4ddc3a82018-04-30 15:51:44 -0700340 dir->i_sb->s_cop->max_namelen,
Eric Biggers549b2062018-01-11 23:30:08 -0500341 &fname->crypto_buf.len))
Eric Biggersb0edc2f2018-01-11 23:30:08 -0500342 return -ENAMETOOLONG;
Eric Biggersb0edc2f2018-01-11 23:30:08 -0500343 fname->crypto_buf.name = kmalloc(fname->crypto_buf.len,
344 GFP_NOFS);
345 if (!fname->crypto_buf.name)
346 return -ENOMEM;
347
348 ret = fname_encrypt(dir, iname, fname->crypto_buf.name,
349 fname->crypto_buf.len);
Eric Biggersef1eb3a2016-09-15 17:25:55 -0400350 if (ret)
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700351 goto errout;
352 fname->disk_name.name = fname->crypto_buf.name;
353 fname->disk_name.len = fname->crypto_buf.len;
354 return 0;
355 }
356 if (!lookup)
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700357 return -ENOKEY;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700358
359 /*
360 * We don't have the key and we are doing a lookup; decode the
361 * user-supplied name
362 */
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700363 if (iname->name[0] == '_') {
364 if (iname->len !=
365 1 + BASE64_CHARS(sizeof(struct fscrypt_digested_name)))
366 return -ENOENT;
367 digested = 1;
368 } else {
369 if (iname->len >
370 BASE64_CHARS(FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE))
371 return -ENOENT;
372 digested = 0;
373 }
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700374
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700375 fname->crypto_buf.name =
376 kmalloc(max_t(size_t, FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE,
377 sizeof(struct fscrypt_digested_name)),
378 GFP_KERNEL);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700379 if (fname->crypto_buf.name == NULL)
380 return -ENOMEM;
381
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700382 ret = digest_decode(iname->name + digested, iname->len - digested,
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700383 fname->crypto_buf.name);
384 if (ret < 0) {
385 ret = -ENOENT;
386 goto errout;
387 }
388 fname->crypto_buf.len = ret;
Jaegeuk Kime6b120d2017-07-10 12:55:09 -0700389 if (digested) {
390 const struct fscrypt_digested_name *n =
391 (const void *)fname->crypto_buf.name;
392 fname->hash = n->hash;
393 fname->minor_hash = n->minor_hash;
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700394 } else {
395 fname->disk_name.name = fname->crypto_buf.name;
396 fname->disk_name.len = fname->crypto_buf.len;
397 }
398 return 0;
399
400errout:
Eric Biggersb0edc2f2018-01-11 23:30:08 -0500401 kfree(fname->crypto_buf.name);
Jaegeuk Kim0b81d072015-05-15 16:26:10 -0700402 return ret;
403}
404EXPORT_SYMBOL(fscrypt_setup_filename);