* [android-common:android14-kiwi-6.1 254/254] fs/smb/client/cifsacl.c:835:26: warning: variable 'end_of_dacl' set but not used
@ 2026-09-07 11:33 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-07 11:33 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common android14-kiwi-6.1
head: 7025f9c2fb2cec65324445321db6486af3876474
commit: c2abdebf72000a64603ced84d36ccbd164f11391 [254/254] smb: client: validate the whole DACL before rewriting it in cifsacl
config: x86_64-randconfig-102-20260907 (https://download.01.org/0day-ci/archive/20260907/202609071902.PsYXupOK-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260907/202609071902.PsYXupOK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609071902.PsYXupOK-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/smb/client/cifsacl.c: In function 'parse_dacl':
>> fs/smb/client/cifsacl.c:835:26: warning: variable 'end_of_dacl' set but not used [-Wunused-but-set-variable]
835 | char *acl_base, *end_of_dacl;
| ^~~~~~~~~~~
vim +/end_of_dacl +835 fs/smb/client/cifsacl.c
827
828 static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
829 struct cifs_sid *pownersid, struct cifs_sid *pgrpsid,
830 struct cifs_fattr *fattr, bool mode_from_special_sid)
831 {
832 int i;
833 int num_aces = 0;
834 int acl_size;
> 835 char *acl_base, *end_of_dacl;
836 struct cifs_ace **ppace;
837
838 /* BB need to add parm so we can store the SID BB */
839
840 if (!pdacl) {
841 /* no DACL in the security descriptor, set
842 all the permissions for user/group/other */
843 fattr->cf_mode |= 0777;
844 return;
845 }
846
847 if (validate_dacl(pdacl, end_of_acl))
848 return;
849
850 cifs_dbg(NOISY, "DACL revision %d size %d num aces %d\n",
851 le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
852 le32_to_cpu(pdacl->num_aces));
853
854 /* reset rwx permissions for user/group/other.
855 Also, if num_aces is 0 i.e. DACL has no ACEs,
856 user/group/other have no permissions */
857 fattr->cf_mode &= ~(0777);
858
859 end_of_dacl = (char *)pdacl + le16_to_cpu(pdacl->size);
860 acl_base = (char *)pdacl;
861 acl_size = sizeof(struct cifs_acl);
862
863 num_aces = le32_to_cpu(pdacl->num_aces);
864 if (num_aces > 0) {
865 umode_t denied_mode = 0;
866
867 if (num_aces > ULONG_MAX / sizeof(struct cifs_ace *))
868 return;
869 ppace = kmalloc_array(num_aces, sizeof(struct cifs_ace *),
870 GFP_KERNEL);
871 if (!ppace)
872 return;
873
874 for (i = 0; i < num_aces; ++i) {
875 ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
876 #ifdef CONFIG_CIFS_DEBUG2
877 dump_ace(ppace[i], end_of_dacl);
878 #endif
879 if (mode_from_special_sid &&
880 ppace[i]->sid.num_subauth >= 3 &&
881 (compare_sids(&(ppace[i]->sid),
882 &sid_unix_NFS_mode) == 0)) {
883 /*
884 * Full permissions are:
885 * 07777 = S_ISUID | S_ISGID | S_ISVTX |
886 * S_IRWXU | S_IRWXG | S_IRWXO
887 */
888 fattr->cf_mode &= ~07777;
889 fattr->cf_mode |=
890 le32_to_cpu(ppace[i]->sid.sub_auth[2]);
891 break;
892 } else {
893 if (compare_sids(&(ppace[i]->sid), pownersid) == 0) {
894 access_flags_to_mode(ppace[i]->access_req,
895 ppace[i]->type,
896 &fattr->cf_mode,
897 &denied_mode,
898 ACL_OWNER_MASK);
899 } else if (compare_sids(&(ppace[i]->sid), pgrpsid) == 0) {
900 access_flags_to_mode(ppace[i]->access_req,
901 ppace[i]->type,
902 &fattr->cf_mode,
903 &denied_mode,
904 ACL_GROUP_MASK);
905 } else if ((compare_sids(&(ppace[i]->sid), &sid_everyone) == 0) ||
906 (compare_sids(&(ppace[i]->sid), &sid_authusers) == 0)) {
907 access_flags_to_mode(ppace[i]->access_req,
908 ppace[i]->type,
909 &fattr->cf_mode,
910 &denied_mode,
911 ACL_EVERYONE_MASK);
912 }
913 }
914
915
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-07 11:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 11:33 [android-common:android14-kiwi-6.1 254/254] fs/smb/client/cifsacl.c:835:26: warning: variable 'end_of_dacl' set but not used kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.