All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android14-kiwi-6.1 254/254] fs/smb/client/cifsacl.c:835:26: warning: variable 'end_of_dacl' set but not used
Date: Mon, 07 Sep 2026 19:33:53 +0800	[thread overview]
Message-ID: <202609071902.PsYXupOK-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-09-07 11:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609071902.PsYXupOK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.