From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [selinuxproject-selinux:stable-5.15 1/1] include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type
Date: Thu, 16 Sep 2021 20:25:13 +0800 [thread overview]
Message-ID: <202109162005.0B2DbkMT-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8012 bytes --]
tree: https://github.com/SELinuxProject/selinux-kernel stable-5.15
head: c491f0a471580712a4254adece400c3ebb3d8e44
commit: c491f0a471580712a4254adece400c3ebb3d8e44 [1/1] lockdown,selinux: fix wrong subject in some SELinux lockdown checks
config: h8300-buildonly-randconfig-r004-20210916 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/SELinuxProject/selinux-kernel/commit/c491f0a471580712a4254adece400c3ebb3d8e44
git remote add selinuxproject-selinux https://github.com/SELinuxProject/selinux-kernel
git fetch --no-tags selinuxproject-selinux stable-5.15
git checkout c491f0a471580712a4254adece400c3ebb3d8e44
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from fs/debugfs/inode.c:15:
fs/debugfs/inode.c: In function 'debugfs_setattr':
>> include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
395 | ({ \
| ~^~~
396 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397 | rcu_check_sparse(p, space); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398 | ((typeof(*p) __force __kernel *)(p)); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399 | })
| ~~
include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_protected'
587 | __rcu_dereference_protected((p), (c), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:299:9: note: in expansion of macro 'rcu_dereference_protected'
299 | rcu_dereference_protected(current->cred, 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
fs/debugfs/inode.c:51:44: note: in expansion of macro 'current_cred'
51 | ret = security_locked_down(current_cred(), LOCKDOWN_DEBUGFS);
| ^~~~~~~~~~~~
In file included from fs/debugfs/inode.c:29:
include/linux/security.h:1347:53: note: expected 'struct cred *' but argument is of type 'const struct cred *'
1347 | static inline int security_locked_down(struct cred *cred, enum lockdown_reason what)
| ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
--
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from fs/debugfs/file.c:12:
fs/debugfs/file.c: In function 'debugfs_locked_down':
>> include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
395 | ({ \
| ~^~~
396 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397 | rcu_check_sparse(p, space); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398 | ((typeof(*p) __force __kernel *)(p)); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399 | })
| ~~
include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_protected'
587 | __rcu_dereference_protected((p), (c), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:299:9: note: in expansion of macro 'rcu_dereference_protected'
299 | rcu_dereference_protected(current->cred, 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
fs/debugfs/file.c:157:34: note: in expansion of macro 'current_cred'
157 | if (security_locked_down(current_cred(), LOCKDOWN_DEBUGFS))
| ^~~~~~~~~~~~
In file included from fs/debugfs/file.c:23:
include/linux/security.h:1347:53: note: expected 'struct cred *' but argument is of type 'const struct cred *'
1347 | static inline int security_locked_down(struct cred *cred, enum lockdown_reason what)
| ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
vim +395 include/linux/rcupdate.h
76c8eaafe4f061 Paul E. McKenney 2021-04-21 379
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 380 #define __rcu_access_pointer(p, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 381 ({ \
7d0ae8086b8283 Paul E. McKenney 2015-03-03 382 typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 383) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 384 ((typeof(*p) __force __kernel *)(_________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 385 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 386 #define __rcu_dereference_check(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 387 ({ \
ac59853c06993a Pranith Kumar 2014-11-13 388 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 389 typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 390 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 391) rcu_check_sparse(p, space); \
ac59853c06993a Pranith Kumar 2014-11-13 392 ((typeof(*p) __force __kernel *)(________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 393 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 394 #define __rcu_dereference_protected(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 @395 ({ \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 396 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 397) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 398 ((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 399 })
995f1405610bd8 Paul E. McKenney 2016-07-01 400 #define rcu_dereference_raw(p) \
995f1405610bd8 Paul E. McKenney 2016-07-01 401 ({ \
995f1405610bd8 Paul E. McKenney 2016-07-01 402 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 403 typeof(p) ________p1 = READ_ONCE(p); \
995f1405610bd8 Paul E. McKenney 2016-07-01 404 ((typeof(*p) __force __kernel *)(________p1)); \
995f1405610bd8 Paul E. McKenney 2016-07-01 405 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 406
:::::: The code at line 395 was first introduced by commit
:::::: ca5ecddfa8fcbd948c95530e7e817cee9fb43a3d rcu: define __rcu address space modifier for sparse
:::::: TO: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
:::::: CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33326 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Paul Moore <paul@paul-moore.com>
Subject: [selinuxproject-selinux:stable-5.15 1/1] include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type
Date: Thu, 16 Sep 2021 20:25:13 +0800 [thread overview]
Message-ID: <202109162005.0B2DbkMT-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 7885 bytes --]
tree: https://github.com/SELinuxProject/selinux-kernel stable-5.15
head: c491f0a471580712a4254adece400c3ebb3d8e44
commit: c491f0a471580712a4254adece400c3ebb3d8e44 [1/1] lockdown,selinux: fix wrong subject in some SELinux lockdown checks
config: h8300-buildonly-randconfig-r004-20210916 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/SELinuxProject/selinux-kernel/commit/c491f0a471580712a4254adece400c3ebb3d8e44
git remote add selinuxproject-selinux https://github.com/SELinuxProject/selinux-kernel
git fetch --no-tags selinuxproject-selinux stable-5.15
git checkout c491f0a471580712a4254adece400c3ebb3d8e44
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from fs/debugfs/inode.c:15:
fs/debugfs/inode.c: In function 'debugfs_setattr':
>> include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
395 | ({ \
| ~^~~
396 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397 | rcu_check_sparse(p, space); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398 | ((typeof(*p) __force __kernel *)(p)); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399 | })
| ~~
include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_protected'
587 | __rcu_dereference_protected((p), (c), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:299:9: note: in expansion of macro 'rcu_dereference_protected'
299 | rcu_dereference_protected(current->cred, 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
fs/debugfs/inode.c:51:44: note: in expansion of macro 'current_cred'
51 | ret = security_locked_down(current_cred(), LOCKDOWN_DEBUGFS);
| ^~~~~~~~~~~~
In file included from fs/debugfs/inode.c:29:
include/linux/security.h:1347:53: note: expected 'struct cred *' but argument is of type 'const struct cred *'
1347 | static inline int security_locked_down(struct cred *cred, enum lockdown_reason what)
| ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
--
In file included from include/linux/rbtree.h:24,
from include/linux/mm_types.h:10,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from fs/debugfs/file.c:12:
fs/debugfs/file.c: In function 'debugfs_locked_down':
>> include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
395 | ({ \
| ~^~~
396 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397 | rcu_check_sparse(p, space); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398 | ((typeof(*p) __force __kernel *)(p)); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399 | })
| ~~
include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_protected'
587 | __rcu_dereference_protected((p), (c), __rcu)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:299:9: note: in expansion of macro 'rcu_dereference_protected'
299 | rcu_dereference_protected(current->cred, 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
fs/debugfs/file.c:157:34: note: in expansion of macro 'current_cred'
157 | if (security_locked_down(current_cred(), LOCKDOWN_DEBUGFS))
| ^~~~~~~~~~~~
In file included from fs/debugfs/file.c:23:
include/linux/security.h:1347:53: note: expected 'struct cred *' but argument is of type 'const struct cred *'
1347 | static inline int security_locked_down(struct cred *cred, enum lockdown_reason what)
| ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
vim +395 include/linux/rcupdate.h
76c8eaafe4f061 Paul E. McKenney 2021-04-21 379
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 380 #define __rcu_access_pointer(p, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 381 ({ \
7d0ae8086b8283 Paul E. McKenney 2015-03-03 382 typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 383) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 384 ((typeof(*p) __force __kernel *)(_________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 385 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 386 #define __rcu_dereference_check(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 387 ({ \
ac59853c06993a Pranith Kumar 2014-11-13 388 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 389 typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 390 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 391) rcu_check_sparse(p, space); \
ac59853c06993a Pranith Kumar 2014-11-13 392 ((typeof(*p) __force __kernel *)(________p1)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 393 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 394 #define __rcu_dereference_protected(p, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 @395 ({ \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 396 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 397) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 398 ((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 399 })
995f1405610bd8 Paul E. McKenney 2016-07-01 400 #define rcu_dereference_raw(p) \
995f1405610bd8 Paul E. McKenney 2016-07-01 401 ({ \
995f1405610bd8 Paul E. McKenney 2016-07-01 402 /* Dependency order vs. p above. */ \
506458efaf153c Will Deacon 2017-10-24 403 typeof(p) ________p1 = READ_ONCE(p); \
995f1405610bd8 Paul E. McKenney 2016-07-01 404 ((typeof(*p) __force __kernel *)(________p1)); \
995f1405610bd8 Paul E. McKenney 2016-07-01 405 })
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 406
:::::: The code at line 395 was first introduced by commit
:::::: ca5ecddfa8fcbd948c95530e7e817cee9fb43a3d rcu: define __rcu address space modifier for sparse
:::::: TO: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
:::::: CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33326 bytes --]
next reply other threads:[~2021-09-16 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-16 12:25 kernel test robot [this message]
2021-09-16 12:25 ` [selinuxproject-selinux:stable-5.15 1/1] include/linux/rcupdate.h:395:2: error: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type kernel test robot
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=202109162005.0B2DbkMT-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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.