oe-lkp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <oliver.sang@intel.com>
To: Eric Biggers <ebiggers@google.com>
Cc: <oe-lkp@lists.linux.dev>, <lkp@intel.com>, <oliver.sang@intel.com>
Subject: [ebiggers:wip-verity] [crypto]  daf2d68fba: UBSAN:shift-out-of-bounds_in_include/linux/log2.h
Date: Tue, 30 Apr 2024 11:20:08 +0800	[thread overview]
Message-ID: <202404301102.dd98490d-oliver.sang@intel.com> (raw)



Hello,

kernel test robot noticed "UBSAN:shift-out-of-bounds_in_include/linux/log2.h" on:

commit: daf2d68fba06b13c4eb6c0b07a31da46f988ba9f ("crypto: testmgr - generate power-of-2 lengths more often")
https://git.kernel.org/cgit/linux/kernel/git/ebiggers/linux.git wip-verity

in testcase: boot

compiler: gcc-13
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)


+---------------------------------------------------+------------+------------+
|                                                   | 9fc50fd0c4 | daf2d68fba |
+---------------------------------------------------+------------+------------+
| UBSAN:shift-out-of-bounds_in_include/linux/log2.h | 0          | 12         |
+---------------------------------------------------+------------+------------+


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 <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202404301102.dd98490d-oliver.sang@intel.com


[   65.669549][ T2612] ------------[ cut here ]------------
[   65.670771][ T2612] UBSAN: shift-out-of-bounds in include/linux/log2.h:67:13
[   65.672859][ T2612] shift exponent 4294967295 is too large for 64-bit type 'long unsigned int'
[   65.674762][ T2612] CPU: 1 PID: 2612 Comm: cryptomgr_test Tainted: G        W          6.9.0-rc4-00002-gdaf2d68fba06 #1
[   65.675758][ T2612] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[   65.675758][ T2612] Call Trace:
[   65.675758][ T2612]  <TASK>
[ 65.675758][ T2612] dump_stack_lvl (lib/dump_stack.c:117) 
[ 65.675758][ T2612] __ubsan_handle_shift_out_of_bounds (lib/ubsan.c:218 lib/ubsan.c:454) 
[ 65.675758][ T2612] generate_random_length.cold (include/linux/log2.h:67 (discriminator 1) crypto/testmgr.c:918 (discriminator 1)) 
[ 65.675758][ T2612] test_hash_vs_generic_impl (crypto/testmgr.c:1704 crypto/testmgr.c:1834) 
[ 65.675758][ T2612] ? __pfx_test_hash_vs_generic_impl (crypto/testmgr.c:1743) 
[ 65.675758][ T2612] ? __kmalloc (include/linux/kasan.h:211 mm/slub.c:3966 mm/slub.c:3979) 
[ 65.675758][ T2612] ? __pfx___might_resched (kernel/sched/core.c:10152) 
[ 65.675758][ T2612] __alg_test_hash (crypto/testmgr.c:1978) 
[ 65.675758][ T2612] alg_test_hash (crypto/testmgr.c:2026) 
[ 65.675758][ T2612] ? finish_task_switch+0x155/0x750 
[ 65.675758][ T2612] alg_test (crypto/testmgr.c:5874) 
[ 65.675758][ T2612] ? __pfx_alg_test (crypto/testmgr.c:5827) 
[ 65.675758][ T2612] ? __pfx___schedule (kernel/sched/core.c:6617) 
[ 65.675758][ T2612] ? try_to_wake_up (include/linux/sched.h:2116 (discriminator 2) kernel/sched/core.c:4382 (discriminator 2)) 
[ 65.675758][ T2612] ? _raw_spin_lock_irqsave (arch/x86/include/asm/atomic.h:115 (discriminator 4) include/linux/atomic/atomic-arch-fallback.h:2170 (discriminator 4) include/linux/atomic/atomic-instrumented.h:1302 (discriminator 4) include/asm-generic/qspinlock.h:111 (discriminator 4) include/linux/spinlock.h:187 (discriminator 4) include/linux/spinlock_api_smp.h:111 (discriminator 4) kernel/locking/spinlock.c:162 (discriminator 4)) 
[ 65.675758][ T2612] ? __pfx__raw_spin_lock_irqsave (kernel/locking/spinlock.c:161) 
[ 65.675758][ T2612] ? set_cpus_allowed_ptr (kernel/sched/core.c:3222) 
[ 65.675758][ T2612] ? __pfx_set_cpus_allowed_ptr (kernel/sched/core.c:3222) 
[ 65.675758][ T2612] ? __pfx_cryptomgr_test (crypto/algboss.c:175) 
[ 65.675758][ T2612] cryptomgr_test (crypto/algboss.c:182) 
[ 65.675758][ T2612] kthread (kernel/kthread.c:388) 
[ 65.675758][ T2612] ? __pfx_kthread (kernel/kthread.c:341) 
[ 65.675758][ T2612] ret_from_fork (arch/x86/kernel/process.c:153) 
[ 65.675758][ T2612] ? __pfx_kthread (kernel/kthread.c:341) 
[ 65.675758][ T2612] ret_from_fork_asm (arch/x86/entry/entry_64.S:257) 
[   65.675758][ T2612]  </TASK>
[   65.711422][ T2612] ---[ end trace ]---



The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240430/202404301102.dd98490d-oliver.sang@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2024-04-30  3:20 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=202404301102.dd98490d-oliver.sang@intel.com \
    --to=oliver.sang@intel.com \
    --cc=ebiggers@google.com \
    --cc=lkp@intel.com \
    --cc=oe-lkp@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).