Commit fdc0396
nfs: unify security_inode_listsecurity() calls
commit 243fea1 ("NFSv4.2: fix listxattr to return selinux
security label") introduced a direct call to
security_inode_listsecurity() in nfs4_listxattr(). However,
nfs4_listxattr() already indirectly called
security_inode_listsecurity() via nfs4_listxattr_nfs4_label() if
CONFIG_NFS_V4_SECURITY_LABEL is enabled and the server has the
NFS_CAP_SECURITY_LABEL capability enabled. This duplication was fixed
by commit 9acb237 ("NFSv4.2: another fix for listxattr") by
making the second call conditional on NFS_CAP_SECURITY_LABEL not being
set by the server. However, the combination of the two changes
effectively makes one call to security_inode_listsecurity() in every
case - which is the desired behavior since getxattr() always returns a
security xattr even if it has to synthesize one. Further, the two
different calls produce different xattr name ordering between
security.* and user.* xattr names. Unify the two separate calls into a
single call and get rid of nfs4_listxattr_nfs4_label() altogether.
Link: https://lore.kernel.org/selinux/CAEjxPJ6e8z__=MP5NfdUxkOMQ=EnUFSjWFofP4YPwHqK=Ki5nw@mail.gmail.com/
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>1 parent 42e7c87 commit fdc0396
1 file changed
Lines changed: 3 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7888 | 7888 | | |
7889 | 7889 | | |
7890 | 7890 | | |
7891 | | - | |
7892 | | - | |
7893 | | - | |
7894 | | - | |
7895 | | - | |
7896 | | - | |
7897 | | - | |
7898 | | - | |
7899 | | - | |
7900 | | - | |
7901 | | - | |
7902 | | - | |
7903 | | - | |
7904 | 7891 | | |
7905 | 7892 | | |
7906 | 7893 | | |
7907 | 7894 | | |
7908 | 7895 | | |
7909 | 7896 | | |
7910 | | - | |
7911 | | - | |
7912 | | - | |
7913 | | - | |
7914 | | - | |
7915 | | - | |
7916 | | - | |
7917 | | - | |
7918 | 7897 | | |
7919 | 7898 | | |
7920 | 7899 | | |
| |||
10553 | 10532 | | |
10554 | 10533 | | |
10555 | 10534 | | |
10556 | | - | |
| 10535 | + | |
10557 | 10536 | | |
10558 | 10537 | | |
10559 | 10538 | | |
| |||
10564 | 10543 | | |
10565 | 10544 | | |
10566 | 10545 | | |
10567 | | - | |
| 10546 | + | |
10568 | 10547 | | |
10569 | 10548 | | |
10570 | | - | |
10571 | 10549 | | |
10572 | 10550 | | |
10573 | 10551 | | |
| |||
10576 | 10554 | | |
10577 | 10555 | | |
10578 | 10556 | | |
10579 | | - | |
10580 | | - | |
10581 | | - | |
10582 | | - | |
10583 | | - | |
10584 | | - | |
10585 | | - | |
10586 | | - | |
10587 | | - | |
10588 | | - | |
10589 | 10557 | | |
10590 | | - | |
| 10558 | + | |
10591 | 10559 | | |
10592 | 10560 | | |
10593 | 10561 | | |
| |||
0 commit comments