From: kernel test robot <lkp@intel.com>
To: Steve French <stfrench@microsoft.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [smfrench-smb3:pr/192 3/3] fs/smb/client/smb2inode.c:124:18: warning: comparison of distinct pointer types ('struct smb2_file_full_ea_info *' and 'u8 *' (aka 'unsigned char *'))
Date: Sun, 03 May 2026 00:18:56 +0200 [thread overview]
Message-ID: <202605030009.Et3z8iAD-lkp@intel.com> (raw)
tree: https://github.com/smfrench/smb3-kernel.git pr/192
head: bedb46d0f4ef3fe98e9da42665bd1d8ec3d013cb
commit: bedb46d0f4ef3fe98e9da42665bd1d8ec3d013cb [3/3] smb/client: fix out-of-bounds read in smb2_compound_op()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260503/202605030009.Et3z8iAD-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260503/202605030009.Et3z8iAD-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/202605030009.Et3z8iAD-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/smb/client/smb2inode.c:124:18: warning: comparison of distinct pointer types ('struct smb2_file_full_ea_info *' and 'u8 *' (aka 'unsigned char *')) [-Wcompare-distinct-pointer-types]
124 | if (ea + outlen > end)
| ~~~~~~~~~~~ ^ ~~~
1 warning generated.
vim +124 fs/smb/client/smb2inode.c
105
106 static int check_wsl_eas(struct kvec *rsp_iov)
107 {
108 struct smb2_file_full_ea_info *ea;
109 struct smb2_query_info_rsp *rsp = rsp_iov->iov_base;
110 unsigned long addr;
111 u32 outlen, next;
112 u16 vlen;
113 u8 nlen;
114 u8 *end;
115
116 outlen = le32_to_cpu(rsp->OutputBufferLength);
117 if (outlen < SMB2_WSL_MIN_QUERY_EA_RESP_SIZE ||
118 outlen > SMB2_WSL_MAX_QUERY_EA_RESP_SIZE)
119 return -EINVAL;
120
121 ea = (void *)((u8 *)rsp_iov->iov_base +
122 le16_to_cpu(rsp->OutputBufferOffset));
123 end = (u8 *)rsp_iov->iov_base + rsp_iov->iov_len;
> 124 if (ea + outlen > end)
125 return -EINVAL;
126
127 for (;;) {
128 if ((u8 *)ea > end - sizeof(*ea))
129 return -EINVAL;
130
131 nlen = ea->ea_name_length;
132 vlen = le16_to_cpu(ea->ea_value_length);
133 if (nlen != SMB2_WSL_XATTR_NAME_LEN ||
134 (u8 *)ea->ea_data + nlen + 1 + vlen > end)
135 return -EINVAL;
136
137 switch (vlen) {
138 case 4:
139 if (strncmp(ea->ea_data, SMB2_WSL_XATTR_UID, nlen) &&
140 strncmp(ea->ea_data, SMB2_WSL_XATTR_GID, nlen) &&
141 strncmp(ea->ea_data, SMB2_WSL_XATTR_MODE, nlen))
142 return -EINVAL;
143 break;
144 case 8:
145 if (strncmp(ea->ea_data, SMB2_WSL_XATTR_DEV, nlen))
146 return -EINVAL;
147 break;
148 case 0:
149 if (!strncmp(ea->ea_data, SMB2_WSL_XATTR_UID, nlen) ||
150 !strncmp(ea->ea_data, SMB2_WSL_XATTR_GID, nlen) ||
151 !strncmp(ea->ea_data, SMB2_WSL_XATTR_MODE, nlen) ||
152 !strncmp(ea->ea_data, SMB2_WSL_XATTR_DEV, nlen))
153 break;
154 fallthrough;
155 default:
156 return -EINVAL;
157 }
158
159 next = le32_to_cpu(ea->next_entry_offset);
160 if (!next)
161 break;
162 if (!IS_ALIGNED(next, 4) ||
163 check_add_overflow((unsigned long)ea, next, &addr))
164 return -EINVAL;
165 ea = (void *)addr;
166 }
167 return 0;
168 }
169
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-02 22:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-02 22:18 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-03 12:54 [smfrench-smb3:pr/192 3/3] fs/smb/client/smb2inode.c:124:18: warning: comparison of distinct pointer types ('struct smb2_file_full_ea_info *' and 'u8 *' (aka 'unsigned char *')) kernel test robot
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=202605030009.Et3z8iAD-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=stfrench@microsoft.com \
/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.