From: kernel test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: oe-kbuild-all@lists.linux.dev, Miguel Ojeda <ojeda@kernel.org>
Subject: [kees:for-next/hardening 28/42] include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored
Date: Mon, 11 Mar 2024 06:30:13 +0800 [thread overview]
Message-ID: <202403110643.27JXEVCI-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
head: 6c069c8d3cfc30c5a399166b6ce63aa42a7d1dac
commit: e697572c09d21678e2e8cc1256af165106fccb7f [28/42] refcount: Annotated intentional signed integer wrap-around
config: um-randconfig-r053-20240310 (https://download.01.org/0day-ci/archive/20240311/202403110643.27JXEVCI-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240311/202403110643.27JXEVCI-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/202403110643.27JXEVCI-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/linux/crypto.h:16:0,
from arch/x86/um/shared/sysdep/kernel-offsets.h:5,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:183:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:263:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
--
In file included from include/linux/kref.h:17:0,
from include/linux/mm_types.h:8,
from include/linux/mmzone.h:22,
from include/linux/gfp.h:7,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:17,
from drivers/clk/clkdev.c:9:
>> include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:183:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:263:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
drivers/clk/clkdev.c: In function 'vclkdev_alloc':
drivers/clk/clkdev.c:173:3: warning: function 'vclkdev_alloc' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap);
^~~~~~~~~~
--
In file included from include/linux/crypto.h:16:0,
from arch/x86/um/shared/sysdep/kernel-offsets.h:5,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:183:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:263:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
--
In file included from include/linux/crypto.h:16:0,
from arch/x86/um/shared/sysdep/kernel-offsets.h:5,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:183:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
include/linux/refcount.h:263:1: warning: 'no_sanitize' attribute directive ignored [-Wattributes]
{
^
vim +/no_sanitize +141 include/linux/refcount.h
fb041bb7c0a918 Will Deacon 2019-11-21 138
e697572c09d216 Kees Cook 2024-02-20 139 static inline __must_check __signed_wrap
e697572c09d216 Kees Cook 2024-02-20 140 bool __refcount_add_not_zero(int i, refcount_t *r, int *oldp)
77e9971c79c295 Will Deacon 2019-11-21 @141 {
dcb786493f3e48 Will Deacon 2019-11-21 142 int old = refcount_read(r);
afed7bcf9487bb Mark Rutland 2018-07-11 143
77e9971c79c295 Will Deacon 2019-11-21 144 do {
dcb786493f3e48 Will Deacon 2019-11-21 145 if (!old)
dcb786493f3e48 Will Deacon 2019-11-21 146 break;
dcb786493f3e48 Will Deacon 2019-11-21 147 } while (!atomic_try_cmpxchg_relaxed(&r->refs, &old, old + i));
f405df5de3170c Peter Zijlstra 2016-11-14 148
a435b9a1435658 Peter Zijlstra 2020-07-29 149 if (oldp)
a435b9a1435658 Peter Zijlstra 2020-07-29 150 *oldp = old;
a435b9a1435658 Peter Zijlstra 2020-07-29 151
1eb085d94256aa Will Deacon 2019-11-21 152 if (unlikely(old < 0 || old + i < 0))
1eb085d94256aa Will Deacon 2019-11-21 153 refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF);
77e9971c79c295 Will Deacon 2019-11-21 154
dcb786493f3e48 Will Deacon 2019-11-21 155 return old;
77e9971c79c295 Will Deacon 2019-11-21 156 }
77e9971c79c295 Will Deacon 2019-11-21 157
:::::: The code at line 141 was first introduced by commit
:::::: 77e9971c79c29542ab7dd4140f9343bf2ff36158 locking/refcount: Move the bulk of the REFCOUNT_FULL implementation into the <linux/refcount.h> header
:::::: TO: Will Deacon <will@kernel.org>
:::::: CC: Ingo Molnar <mingo@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-03-10 22:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-10 22:30 kernel test robot [this message]
2024-03-13 3:48 ` [kees:for-next/hardening 28/42] include/linux/refcount.h:141:1: warning: 'no_sanitize' attribute directive ignored Kees Cook
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=202403110643.27JXEVCI-lkp@intel.com \
--to=lkp@intel.com \
--cc=keescook@chromium.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ojeda@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.