]> asedeno.scripts.mit.edu Git - linux.git/blob - fs/erofs/xattr.c
staging: rtl8192u: fix spacing in ieee80211
[linux.git] / fs / erofs / xattr.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2017-2018 HUAWEI, Inc.
4  *             http://www.huawei.com/
5  * Created by Gao Xiang <gaoxiang25@huawei.com>
6  */
7 #include <linux/security.h>
8 #include "xattr.h"
9
10 struct xattr_iter {
11         struct super_block *sb;
12         struct page *page;
13         void *kaddr;
14
15         erofs_blk_t blkaddr;
16         unsigned int ofs;
17 };
18
19 static inline void xattr_iter_end(struct xattr_iter *it, bool atomic)
20 {
21         /* the only user of kunmap() is 'init_inode_xattrs' */
22         if (unlikely(!atomic))
23                 kunmap(it->page);
24         else
25                 kunmap_atomic(it->kaddr);
26
27         unlock_page(it->page);
28         put_page(it->page);
29 }
30
31 static inline void xattr_iter_end_final(struct xattr_iter *it)
32 {
33         if (!it->page)
34                 return;
35
36         xattr_iter_end(it, true);
37 }
38
39 static int init_inode_xattrs(struct inode *inode)
40 {
41         struct erofs_vnode *const vi = EROFS_V(inode);
42         struct xattr_iter it;
43         unsigned int i;
44         struct erofs_xattr_ibody_header *ih;
45         struct super_block *sb;
46         struct erofs_sb_info *sbi;
47         bool atomic_map;
48         int ret = 0;
49
50         /* the most case is that xattrs of this inode are initialized. */
51         if (test_bit(EROFS_V_EA_INITED_BIT, &vi->flags))
52                 return 0;
53
54         if (wait_on_bit_lock(&vi->flags, EROFS_V_BL_XATTR_BIT, TASK_KILLABLE))
55                 return -ERESTARTSYS;
56
57         /* someone has initialized xattrs for us? */
58         if (test_bit(EROFS_V_EA_INITED_BIT, &vi->flags))
59                 goto out_unlock;
60
61         /*
62          * bypass all xattr operations if ->xattr_isize is not greater than
63          * sizeof(struct erofs_xattr_ibody_header), in detail:
64          * 1) it is not enough to contain erofs_xattr_ibody_header then
65          *    ->xattr_isize should be 0 (it means no xattr);
66          * 2) it is just to contain erofs_xattr_ibody_header, which is on-disk
67          *    undefined right now (maybe use later with some new sb feature).
68          */
69         if (vi->xattr_isize == sizeof(struct erofs_xattr_ibody_header)) {
70                 errln("xattr_isize %d of nid %llu is not supported yet",
71                       vi->xattr_isize, vi->nid);
72                 ret = -EOPNOTSUPP;
73                 goto out_unlock;
74         } else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) {
75                 if (unlikely(vi->xattr_isize)) {
76                         errln("bogus xattr ibody @ nid %llu", vi->nid);
77                         DBG_BUGON(1);
78                         ret = -EFSCORRUPTED;
79                         goto out_unlock;        /* xattr ondisk layout error */
80                 }
81                 ret = -ENOATTR;
82                 goto out_unlock;
83         }
84
85         sb = inode->i_sb;
86         sbi = EROFS_SB(sb);
87         it.blkaddr = erofs_blknr(iloc(sbi, vi->nid) + vi->inode_isize);
88         it.ofs = erofs_blkoff(iloc(sbi, vi->nid) + vi->inode_isize);
89
90         it.page = erofs_get_inline_page(inode, it.blkaddr);
91         if (IS_ERR(it.page)) {
92                 ret = PTR_ERR(it.page);
93                 goto out_unlock;
94         }
95
96         /* read in shared xattr array (non-atomic, see kmalloc below) */
97         it.kaddr = kmap(it.page);
98         atomic_map = false;
99
100         ih = (struct erofs_xattr_ibody_header *)(it.kaddr + it.ofs);
101
102         vi->xattr_shared_count = ih->h_shared_count;
103         vi->xattr_shared_xattrs = kmalloc_array(vi->xattr_shared_count,
104                                                 sizeof(uint), GFP_KERNEL);
105         if (!vi->xattr_shared_xattrs) {
106                 xattr_iter_end(&it, atomic_map);
107                 ret = -ENOMEM;
108                 goto out_unlock;
109         }
110
111         /* let's skip ibody header */
112         it.ofs += sizeof(struct erofs_xattr_ibody_header);
113
114         for (i = 0; i < vi->xattr_shared_count; ++i) {
115                 if (unlikely(it.ofs >= EROFS_BLKSIZ)) {
116                         /* cannot be unaligned */
117                         DBG_BUGON(it.ofs != EROFS_BLKSIZ);
118                         xattr_iter_end(&it, atomic_map);
119
120                         it.page = erofs_get_meta_page(sb, ++it.blkaddr,
121                                                       S_ISDIR(inode->i_mode));
122                         if (IS_ERR(it.page)) {
123                                 kfree(vi->xattr_shared_xattrs);
124                                 vi->xattr_shared_xattrs = NULL;
125                                 ret = PTR_ERR(it.page);
126                                 goto out_unlock;
127                         }
128
129                         it.kaddr = kmap_atomic(it.page);
130                         atomic_map = true;
131                         it.ofs = 0;
132                 }
133                 vi->xattr_shared_xattrs[i] =
134                         le32_to_cpu(*(__le32 *)(it.kaddr + it.ofs));
135                 it.ofs += sizeof(__le32);
136         }
137         xattr_iter_end(&it, atomic_map);
138
139         set_bit(EROFS_V_EA_INITED_BIT, &vi->flags);
140
141 out_unlock:
142         clear_and_wake_up_bit(EROFS_V_BL_XATTR_BIT, &vi->flags);
143         return ret;
144 }
145
146 /*
147  * the general idea for these return values is
148  * if    0 is returned, go on processing the current xattr;
149  *       1 (> 0) is returned, skip this round to process the next xattr;
150  *    -err (< 0) is returned, an error (maybe ENOXATTR) occurred
151  *                            and need to be handled
152  */
153 struct xattr_iter_handlers {
154         int (*entry)(struct xattr_iter *_it, struct erofs_xattr_entry *entry);
155         int (*name)(struct xattr_iter *_it, unsigned int processed, char *buf,
156                     unsigned int len);
157         int (*alloc_buffer)(struct xattr_iter *_it, unsigned int value_sz);
158         void (*value)(struct xattr_iter *_it, unsigned int processed, char *buf,
159                       unsigned int len);
160 };
161
162 static inline int xattr_iter_fixup(struct xattr_iter *it)
163 {
164         if (it->ofs < EROFS_BLKSIZ)
165                 return 0;
166
167         xattr_iter_end(it, true);
168
169         it->blkaddr += erofs_blknr(it->ofs);
170
171         it->page = erofs_get_meta_page(it->sb, it->blkaddr, false);
172         if (IS_ERR(it->page)) {
173                 int err = PTR_ERR(it->page);
174
175                 it->page = NULL;
176                 return err;
177         }
178
179         it->kaddr = kmap_atomic(it->page);
180         it->ofs = erofs_blkoff(it->ofs);
181         return 0;
182 }
183
184 static int inline_xattr_iter_begin(struct xattr_iter *it,
185                                    struct inode *inode)
186 {
187         struct erofs_vnode *const vi = EROFS_V(inode);
188         struct erofs_sb_info *const sbi = EROFS_SB(inode->i_sb);
189         unsigned int xattr_header_sz, inline_xattr_ofs;
190
191         xattr_header_sz = inlinexattr_header_size(inode);
192         if (unlikely(xattr_header_sz >= vi->xattr_isize)) {
193                 DBG_BUGON(xattr_header_sz > vi->xattr_isize);
194                 return -ENOATTR;
195         }
196
197         inline_xattr_ofs = vi->inode_isize + xattr_header_sz;
198
199         it->blkaddr = erofs_blknr(iloc(sbi, vi->nid) + inline_xattr_ofs);
200         it->ofs = erofs_blkoff(iloc(sbi, vi->nid) + inline_xattr_ofs);
201
202         it->page = erofs_get_inline_page(inode, it->blkaddr);
203         if (IS_ERR(it->page))
204                 return PTR_ERR(it->page);
205
206         it->kaddr = kmap_atomic(it->page);
207         return vi->xattr_isize - xattr_header_sz;
208 }
209
210 /*
211  * Regardless of success or failure, `xattr_foreach' will end up with
212  * `ofs' pointing to the next xattr item rather than an arbitrary position.
213  */
214 static int xattr_foreach(struct xattr_iter *it,
215                          const struct xattr_iter_handlers *op,
216                          unsigned int *tlimit)
217 {
218         struct erofs_xattr_entry entry;
219         unsigned int value_sz, processed, slice;
220         int err;
221
222         /* 0. fixup blkaddr, ofs, ipage */
223         err = xattr_iter_fixup(it);
224         if (err)
225                 return err;
226
227         /*
228          * 1. read xattr entry to the memory,
229          *    since we do EROFS_XATTR_ALIGN
230          *    therefore entry should be in the page
231          */
232         entry = *(struct erofs_xattr_entry *)(it->kaddr + it->ofs);
233         if (tlimit) {
234                 unsigned int entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);
235
236                 /* xattr on-disk corruption: xattr entry beyond xattr_isize */
237                 if (unlikely(*tlimit < entry_sz)) {
238                         DBG_BUGON(1);
239                         return -EFSCORRUPTED;
240                 }
241                 *tlimit -= entry_sz;
242         }
243
244         it->ofs += sizeof(struct erofs_xattr_entry);
245         value_sz = le16_to_cpu(entry.e_value_size);
246
247         /* handle entry */
248         err = op->entry(it, &entry);
249         if (err) {
250                 it->ofs += entry.e_name_len + value_sz;
251                 goto out;
252         }
253
254         /* 2. handle xattr name (ofs will finally be at the end of name) */
255         processed = 0;
256
257         while (processed < entry.e_name_len) {
258                 if (it->ofs >= EROFS_BLKSIZ) {
259                         DBG_BUGON(it->ofs > EROFS_BLKSIZ);
260
261                         err = xattr_iter_fixup(it);
262                         if (err)
263                                 goto out;
264                         it->ofs = 0;
265                 }
266
267                 slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
268                               entry.e_name_len - processed);
269
270                 /* handle name */
271                 err = op->name(it, processed, it->kaddr + it->ofs, slice);
272                 if (err) {
273                         it->ofs += entry.e_name_len - processed + value_sz;
274                         goto out;
275                 }
276
277                 it->ofs += slice;
278                 processed += slice;
279         }
280
281         /* 3. handle xattr value */
282         processed = 0;
283
284         if (op->alloc_buffer) {
285                 err = op->alloc_buffer(it, value_sz);
286                 if (err) {
287                         it->ofs += value_sz;
288                         goto out;
289                 }
290         }
291
292         while (processed < value_sz) {
293                 if (it->ofs >= EROFS_BLKSIZ) {
294                         DBG_BUGON(it->ofs > EROFS_BLKSIZ);
295
296                         err = xattr_iter_fixup(it);
297                         if (err)
298                                 goto out;
299                         it->ofs = 0;
300                 }
301
302                 slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
303                               value_sz - processed);
304                 op->value(it, processed, it->kaddr + it->ofs, slice);
305                 it->ofs += slice;
306                 processed += slice;
307         }
308
309 out:
310         /* xattrs should be 4-byte aligned (on-disk constraint) */
311         it->ofs = EROFS_XATTR_ALIGN(it->ofs);
312         return err < 0 ? err : 0;
313 }
314
315 struct getxattr_iter {
316         struct xattr_iter it;
317
318         char *buffer;
319         int buffer_size, index;
320         struct qstr name;
321 };
322
323 static int xattr_entrymatch(struct xattr_iter *_it,
324                             struct erofs_xattr_entry *entry)
325 {
326         struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
327
328         return (it->index != entry->e_name_index ||
329                 it->name.len != entry->e_name_len) ? -ENOATTR : 0;
330 }
331
332 static int xattr_namematch(struct xattr_iter *_it,
333                            unsigned int processed, char *buf, unsigned int len)
334 {
335         struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
336
337         return memcmp(buf, it->name.name + processed, len) ? -ENOATTR : 0;
338 }
339
340 static int xattr_checkbuffer(struct xattr_iter *_it,
341                              unsigned int value_sz)
342 {
343         struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
344         int err = it->buffer_size < value_sz ? -ERANGE : 0;
345
346         it->buffer_size = value_sz;
347         return !it->buffer ? 1 : err;
348 }
349
350 static void xattr_copyvalue(struct xattr_iter *_it,
351                             unsigned int processed,
352                             char *buf, unsigned int len)
353 {
354         struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
355
356         memcpy(it->buffer + processed, buf, len);
357 }
358
359 static const struct xattr_iter_handlers find_xattr_handlers = {
360         .entry = xattr_entrymatch,
361         .name = xattr_namematch,
362         .alloc_buffer = xattr_checkbuffer,
363         .value = xattr_copyvalue
364 };
365
366 static int inline_getxattr(struct inode *inode, struct getxattr_iter *it)
367 {
368         int ret;
369         unsigned int remaining;
370
371         ret = inline_xattr_iter_begin(&it->it, inode);
372         if (ret < 0)
373                 return ret;
374
375         remaining = ret;
376         while (remaining) {
377                 ret = xattr_foreach(&it->it, &find_xattr_handlers, &remaining);
378                 if (ret != -ENOATTR)
379                         break;
380         }
381         xattr_iter_end_final(&it->it);
382
383         return ret ? ret : it->buffer_size;
384 }
385
386 static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
387 {
388         struct erofs_vnode *const vi = EROFS_V(inode);
389         struct super_block *const sb = inode->i_sb;
390         struct erofs_sb_info *const sbi = EROFS_SB(sb);
391         unsigned int i;
392         int ret = -ENOATTR;
393
394         for (i = 0; i < vi->xattr_shared_count; ++i) {
395                 erofs_blk_t blkaddr =
396                         xattrblock_addr(sbi, vi->xattr_shared_xattrs[i]);
397
398                 it->it.ofs = xattrblock_offset(sbi, vi->xattr_shared_xattrs[i]);
399
400                 if (!i || blkaddr != it->it.blkaddr) {
401                         if (i)
402                                 xattr_iter_end(&it->it, true);
403
404                         it->it.page = erofs_get_meta_page(sb, blkaddr, false);
405                         if (IS_ERR(it->it.page))
406                                 return PTR_ERR(it->it.page);
407
408                         it->it.kaddr = kmap_atomic(it->it.page);
409                         it->it.blkaddr = blkaddr;
410                 }
411
412                 ret = xattr_foreach(&it->it, &find_xattr_handlers, NULL);
413                 if (ret != -ENOATTR)
414                         break;
415         }
416         if (vi->xattr_shared_count)
417                 xattr_iter_end_final(&it->it);
418
419         return ret ? ret : it->buffer_size;
420 }
421
422 static bool erofs_xattr_user_list(struct dentry *dentry)
423 {
424         return test_opt(EROFS_SB(dentry->d_sb), XATTR_USER);
425 }
426
427 static bool erofs_xattr_trusted_list(struct dentry *dentry)
428 {
429         return capable(CAP_SYS_ADMIN);
430 }
431
432 int erofs_getxattr(struct inode *inode, int index,
433                    const char *name,
434                    void *buffer, size_t buffer_size)
435 {
436         int ret;
437         struct getxattr_iter it;
438
439         if (unlikely(!name))
440                 return -EINVAL;
441
442         ret = init_inode_xattrs(inode);
443         if (ret)
444                 return ret;
445
446         it.index = index;
447
448         it.name.len = strlen(name);
449         if (it.name.len > EROFS_NAME_LEN)
450                 return -ERANGE;
451         it.name.name = name;
452
453         it.buffer = buffer;
454         it.buffer_size = buffer_size;
455
456         it.it.sb = inode->i_sb;
457         ret = inline_getxattr(inode, &it);
458         if (ret == -ENOATTR)
459                 ret = shared_getxattr(inode, &it);
460         return ret;
461 }
462
463 static int erofs_xattr_generic_get(const struct xattr_handler *handler,
464                                    struct dentry *unused, struct inode *inode,
465                                    const char *name, void *buffer, size_t size)
466 {
467         struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
468
469         switch (handler->flags) {
470         case EROFS_XATTR_INDEX_USER:
471                 if (!test_opt(sbi, XATTR_USER))
472                         return -EOPNOTSUPP;
473                 break;
474         case EROFS_XATTR_INDEX_TRUSTED:
475                 if (!capable(CAP_SYS_ADMIN))
476                         return -EPERM;
477                 break;
478         case EROFS_XATTR_INDEX_SECURITY:
479                 break;
480         default:
481                 return -EINVAL;
482         }
483
484         return erofs_getxattr(inode, handler->flags, name, buffer, size);
485 }
486
487 const struct xattr_handler erofs_xattr_user_handler = {
488         .prefix = XATTR_USER_PREFIX,
489         .flags  = EROFS_XATTR_INDEX_USER,
490         .list   = erofs_xattr_user_list,
491         .get    = erofs_xattr_generic_get,
492 };
493
494 const struct xattr_handler erofs_xattr_trusted_handler = {
495         .prefix = XATTR_TRUSTED_PREFIX,
496         .flags  = EROFS_XATTR_INDEX_TRUSTED,
497         .list   = erofs_xattr_trusted_list,
498         .get    = erofs_xattr_generic_get,
499 };
500
501 #ifdef CONFIG_EROFS_FS_SECURITY
502 const struct xattr_handler __maybe_unused erofs_xattr_security_handler = {
503         .prefix = XATTR_SECURITY_PREFIX,
504         .flags  = EROFS_XATTR_INDEX_SECURITY,
505         .get    = erofs_xattr_generic_get,
506 };
507 #endif
508
509 const struct xattr_handler *erofs_xattr_handlers[] = {
510         &erofs_xattr_user_handler,
511 #ifdef CONFIG_EROFS_FS_POSIX_ACL
512         &posix_acl_access_xattr_handler,
513         &posix_acl_default_xattr_handler,
514 #endif
515         &erofs_xattr_trusted_handler,
516 #ifdef CONFIG_EROFS_FS_SECURITY
517         &erofs_xattr_security_handler,
518 #endif
519         NULL,
520 };
521
522 struct listxattr_iter {
523         struct xattr_iter it;
524
525         struct dentry *dentry;
526         char *buffer;
527         int buffer_size, buffer_ofs;
528 };
529
530 static int xattr_entrylist(struct xattr_iter *_it,
531                            struct erofs_xattr_entry *entry)
532 {
533         struct listxattr_iter *it =
534                 container_of(_it, struct listxattr_iter, it);
535         unsigned int prefix_len;
536         const char *prefix;
537
538         const struct xattr_handler *h =
539                 erofs_xattr_handler(entry->e_name_index);
540
541         if (!h || (h->list && !h->list(it->dentry)))
542                 return 1;
543
544         prefix = xattr_prefix(h);
545         prefix_len = strlen(prefix);
546
547         if (!it->buffer) {
548                 it->buffer_ofs += prefix_len + entry->e_name_len + 1;
549                 return 1;
550         }
551
552         if (it->buffer_ofs + prefix_len
553                 + entry->e_name_len + 1 > it->buffer_size)
554                 return -ERANGE;
555
556         memcpy(it->buffer + it->buffer_ofs, prefix, prefix_len);
557         it->buffer_ofs += prefix_len;
558         return 0;
559 }
560
561 static int xattr_namelist(struct xattr_iter *_it,
562                           unsigned int processed, char *buf, unsigned int len)
563 {
564         struct listxattr_iter *it =
565                 container_of(_it, struct listxattr_iter, it);
566
567         memcpy(it->buffer + it->buffer_ofs, buf, len);
568         it->buffer_ofs += len;
569         return 0;
570 }
571
572 static int xattr_skipvalue(struct xattr_iter *_it,
573                            unsigned int value_sz)
574 {
575         struct listxattr_iter *it =
576                 container_of(_it, struct listxattr_iter, it);
577
578         it->buffer[it->buffer_ofs++] = '\0';
579         return 1;
580 }
581
582 static const struct xattr_iter_handlers list_xattr_handlers = {
583         .entry = xattr_entrylist,
584         .name = xattr_namelist,
585         .alloc_buffer = xattr_skipvalue,
586         .value = NULL
587 };
588
589 static int inline_listxattr(struct listxattr_iter *it)
590 {
591         int ret;
592         unsigned int remaining;
593
594         ret = inline_xattr_iter_begin(&it->it, d_inode(it->dentry));
595         if (ret < 0)
596                 return ret;
597
598         remaining = ret;
599         while (remaining) {
600                 ret = xattr_foreach(&it->it, &list_xattr_handlers, &remaining);
601                 if (ret)
602                         break;
603         }
604         xattr_iter_end_final(&it->it);
605         return ret ? ret : it->buffer_ofs;
606 }
607
608 static int shared_listxattr(struct listxattr_iter *it)
609 {
610         struct inode *const inode = d_inode(it->dentry);
611         struct erofs_vnode *const vi = EROFS_V(inode);
612         struct super_block *const sb = inode->i_sb;
613         struct erofs_sb_info *const sbi = EROFS_SB(sb);
614         unsigned int i;
615         int ret = 0;
616
617         for (i = 0; i < vi->xattr_shared_count; ++i) {
618                 erofs_blk_t blkaddr =
619                         xattrblock_addr(sbi, vi->xattr_shared_xattrs[i]);
620
621                 it->it.ofs = xattrblock_offset(sbi, vi->xattr_shared_xattrs[i]);
622                 if (!i || blkaddr != it->it.blkaddr) {
623                         if (i)
624                                 xattr_iter_end(&it->it, true);
625
626                         it->it.page = erofs_get_meta_page(sb, blkaddr, false);
627                         if (IS_ERR(it->it.page))
628                                 return PTR_ERR(it->it.page);
629
630                         it->it.kaddr = kmap_atomic(it->it.page);
631                         it->it.blkaddr = blkaddr;
632                 }
633
634                 ret = xattr_foreach(&it->it, &list_xattr_handlers, NULL);
635                 if (ret)
636                         break;
637         }
638         if (vi->xattr_shared_count)
639                 xattr_iter_end_final(&it->it);
640
641         return ret ? ret : it->buffer_ofs;
642 }
643
644 ssize_t erofs_listxattr(struct dentry *dentry,
645                         char *buffer, size_t buffer_size)
646 {
647         int ret;
648         struct listxattr_iter it;
649
650         ret = init_inode_xattrs(d_inode(dentry));
651         if (ret)
652                 return ret;
653
654         it.dentry = dentry;
655         it.buffer = buffer;
656         it.buffer_size = buffer_size;
657         it.buffer_ofs = 0;
658
659         it.it.sb = dentry->d_sb;
660
661         ret = inline_listxattr(&it);
662         if (ret < 0 && ret != -ENOATTR)
663                 return ret;
664         return shared_listxattr(&it);
665 }
666
667 #ifdef CONFIG_EROFS_FS_POSIX_ACL
668 struct posix_acl *erofs_get_acl(struct inode *inode, int type)
669 {
670         struct posix_acl *acl;
671         int prefix, rc;
672         char *value = NULL;
673
674         switch (type) {
675         case ACL_TYPE_ACCESS:
676                 prefix = EROFS_XATTR_INDEX_POSIX_ACL_ACCESS;
677                 break;
678         case ACL_TYPE_DEFAULT:
679                 prefix = EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT;
680                 break;
681         default:
682                 return ERR_PTR(-EINVAL);
683         }
684
685         rc = erofs_getxattr(inode, prefix, "", NULL, 0);
686         if (rc > 0) {
687                 value = kmalloc(rc, GFP_KERNEL);
688                 if (!value)
689                         return ERR_PTR(-ENOMEM);
690                 rc = erofs_getxattr(inode, prefix, "", value, rc);
691         }
692
693         if (rc == -ENOATTR)
694                 acl = NULL;
695         else if (rc < 0)
696                 acl = ERR_PTR(rc);
697         else
698                 acl = posix_acl_from_xattr(&init_user_ns, value, rc);
699         kfree(value);
700         return acl;
701 }
702 #endif
703