All of lore.kernel.org
 help / color / mirror / Atom feed
* [kkdwivedi:fermata 254/348] kernel/bpf/coro.c:143 bpf_coro_frame_class() error: buffer overflow 'small' 8 <= 576460752303423487
@ 2026-11-27 15:49 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-27 15:49 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kumar Kartikeya Dwivedi <memxor@gmail.com>

tree:   https://github.com/kkdwivedi/linux fermata
head:   1d98f92a7b37670e804415b13c1d5d039706d4ce
commit: 4d3cd4b6be701549f74ad943124f4ed5bef27765 [254/348] bpf: Keep the coroutine frames that a program frees for its next ones
:::::: branch date: 9 hours ago
:::::: commit date: 11 hours ago
config: arm64-randconfig-2200-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127164144.CF3Gx2AP-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 578b1f2d6a9776b63cbb6b86f4cca6208d429f48)
smatch: v0.5.0-9187-g5189e3fb

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/20261127164144.CF3Gx2AP-lkp@intel.com/

smatch warnings:
kernel/bpf/coro.c:143 bpf_coro_frame_class() error: buffer overflow 'small' 8 <= 576460752303423487

vim +/small +143 kernel/bpf/coro.c

4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  131  
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  132  static_assert(sizeof(struct bpf_coro_frame_hdr) + BPF_MAX_REF_SLOTS * BPF_REG_SIZE <= 1024);
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  133  static_assert(BPF_CORO_FRAME_CLASSES <=
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  134  	      BITS_PER_TYPE(typeof_member(struct bpf_prog_aux, coro_classes)));
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  135  
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  136  /* @size is that of the header and the frame */
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  137  static unsigned int bpf_coro_frame_class(size_t size)
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  138  {
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  139  	/* in steps of 32 bytes up to 256 */
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  140  	static const u8 small[] = { 1, 2, 3, 4, 5, 5, 6, 6 };
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  141  
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  142  	if (size <= 256)
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26 @143  		return small[(size - 1) / 32];
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  144  	return size <= 512 ? 7 : 8;
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  145  }
4d3cd4b6be7015 Kumar Kartikeya Dwivedi 2026-11-26  146  

-- 
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-11-27 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 15:49 [kkdwivedi:fermata 254/348] kernel/bpf/coro.c:143 bpf_coro_frame_class() error: buffer overflow 'small' 8 <= 576460752303423487 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.