All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, Borislav Petkov <bp@suse.de>
Subject: [tip:x86/cpu 2/3] arch/x86/kernel/alternative.c:96:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+10' is out of bounds.
Date: Tue, 16 Mar 2021 07:50:10 +0800	[thread overview]
Message-ID: <202103160701.3uXlWiWM-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/cpu
head:   301cddc21a157a3072d789a3097857202e550a24
commit: a89dfde3dc3c2dbf56910af75e2d8b11ec5308f6 [2/3] x86: Remove dynamic NOP selection
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> arch/x86/kernel/alternative.c:96:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+10' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4,
            ^
   arch/x86/kernel/alternative.c:97:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+15' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5,
            ^
   arch/x86/kernel/alternative.c:98:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+21' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5 + 6,
            ^
   arch/x86/kernel/alternative.c:99:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+28' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
            ^
>> arch/x86/kernel/ftrace.c:304:7: warning: union member 'ftrace_op_code_union::code' is never used. [unusedStructMember]
    char code[OP_REF_SIZE];
         ^

vim +96 arch/x86/kernel/alternative.c

    88	
    89	const unsigned char * const x86_nops[ASM_NOP_MAX+1] =
    90	{
    91		NULL,
    92		x86nops,
    93		x86nops + 1,
    94		x86nops + 1 + 2,
    95		x86nops + 1 + 2 + 3,
  > 96		x86nops + 1 + 2 + 3 + 4,
    97		x86nops + 1 + 2 + 3 + 4 + 5,
    98		x86nops + 1 + 2 + 3 + 4 + 5 + 6,
    99		x86nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
   100	};
   101	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [tip:x86/cpu 2/3] arch/x86/kernel/alternative.c:96:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+10' is out of bounds.
Date: Tue, 16 Mar 2021 07:50:10 +0800	[thread overview]
Message-ID: <202103160701.3uXlWiWM-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/cpu
head:   301cddc21a157a3072d789a3097857202e550a24
commit: a89dfde3dc3c2dbf56910af75e2d8b11ec5308f6 [2/3] x86: Remove dynamic NOP selection
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> arch/x86/kernel/alternative.c:96:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+10' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4,
            ^
   arch/x86/kernel/alternative.c:97:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+15' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5,
            ^
   arch/x86/kernel/alternative.c:98:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+21' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5 + 6,
            ^
   arch/x86/kernel/alternative.c:99:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+28' is out of bounds. [pointerOutOfBounds]
    x86nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
            ^
>> arch/x86/kernel/ftrace.c:304:7: warning: union member 'ftrace_op_code_union::code' is never used. [unusedStructMember]
    char code[OP_REF_SIZE];
         ^

vim +96 arch/x86/kernel/alternative.c

    88	
    89	const unsigned char * const x86_nops[ASM_NOP_MAX+1] =
    90	{
    91		NULL,
    92		x86nops,
    93		x86nops + 1,
    94		x86nops + 1 + 2,
    95		x86nops + 1 + 2 + 3,
  > 96		x86nops + 1 + 2 + 3 + 4,
    97		x86nops + 1 + 2 + 3 + 4 + 5,
    98		x86nops + 1 + 2 + 3 + 4 + 5 + 6,
    99		x86nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
   100	};
   101	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2021-03-15 23:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 23:50 kernel test robot [this message]
2021-03-15 23:50 ` [tip:x86/cpu 2/3] arch/x86/kernel/alternative.c:96:10: warning: Undefined behaviour, pointer arithmetic 'x86nops+10' is out of bounds kernel test robot
2021-03-16  8:27 ` Borislav Petkov
2021-03-16  8:27   ` Borislav Petkov
2021-03-16  9:01   ` Peter Zijlstra
2021-03-16  9:01     ` Peter Zijlstra
2021-03-16 10:01   ` [kbuild-all] " Rong Chen
2021-03-16 10:01     ` Rong Chen

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=202103160701.3uXlWiWM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bp@suse.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /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.