From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 11033/12060] fs/bcachefs/sb-clean.c:286:55: sparse: sparse: cast to restricted __le16
Date: Wed, 8 May 2024 20:48:44 +0800 [thread overview]
Message-ID: <202405082039.0al6Fpg8-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b4ef8fffaca247809337bb78daceb406659f2d
commit: f39055220f6f98a180e3503fe05bbf9921c425c8 [11033/12060] bcachefs: Add missing validation for superblock section clean
config: x86_64-randconfig-121-20240508 (https://download.01.org/0day-ci/archive/20240508/202405082039.0al6Fpg8-lkp@intel.com/config)
compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240508/202405082039.0al6Fpg8-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/202405082039.0al6Fpg8-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
fs/bcachefs/sb-clean.c: note: in included file:
fs/bcachefs/bcachefs.h:1027:9: sparse: sparse: array of flexible structures
fs/bcachefs/sb-clean.c: note: in included file (through fs/bcachefs/bcachefs.h):
fs/bcachefs/bcachefs_format.h:800:38: sparse: sparse: array of flexible structures
fs/bcachefs/bcachefs_format.h:1459:38: sparse: sparse: array of flexible structures
>> fs/bcachefs/sb-clean.c:286:55: sparse: sparse: cast to restricted __le16
vim +286 fs/bcachefs/sb-clean.c
268
269 static int bch2_sb_clean_validate(struct bch_sb *sb,
270 struct bch_sb_field *f,
271 struct printbuf *err)
272 {
273 struct bch_sb_field_clean *clean = field_to_type(f, clean);
274
275 if (vstruct_bytes(&clean->field) < sizeof(*clean)) {
276 prt_printf(err, "wrong size (got %zu should be %zu)",
277 vstruct_bytes(&clean->field), sizeof(*clean));
278 return -BCH_ERR_invalid_sb_clean;
279 }
280
281 for (struct jset_entry *entry = clean->start;
282 entry != vstruct_end(&clean->field);
283 entry = vstruct_next(entry)) {
284 if ((void *) vstruct_next(entry) > vstruct_end(&clean->field)) {
285 prt_str(err, "entry type ");
> 286 bch2_prt_jset_entry_type(err, le16_to_cpu(entry->type));
287 prt_str(err, " overruns end of section");
288 return -BCH_ERR_invalid_sb_clean;
289 }
290 }
291
292 return 0;
293 }
294
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-05-08 12:49 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=202405082039.0al6Fpg8-lkp@intel.com \
--to=lkp@intel.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-mm@kvack.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).