All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
@ 2021-10-13  8:16 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-10-13  8:16 UTC (permalink / raw)
  To: Paul Moore; +Cc: kbuild-all, Linux Memory Management List

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

Hi Paul,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8006b911c90a4ec09958447d24c8a4c3538f5723
commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze 

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 >>):

>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
     408 | LSM_HOOK(int, 0, uring_sqpoll, void)
         |                  ^~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
     408 | LSM_HOOK(int, 0, uring_sqpoll, void)
         | ^~~~~~~~
>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
     407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
         |                  ^~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
     407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
     396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
         |                  ^~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
     396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
     392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
         |                  ^~~~~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
     392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
     390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
         |                  ^~~~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
     390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
     389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
         |                  ^~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
     389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
     388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
         |                  ^~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
     388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
     387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
         |                  ^~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
     387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
     382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
         |                  ^~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
     382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
     381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
         |                  ^~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)


vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h

   405	
   406	#ifdef CONFIG_IO_URING
 > 407	LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
 > 408	LSM_HOOK(int, 0, uring_sqpoll, void)

---
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: 35092 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
@ 2021-10-13  8:16 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-10-13  8:16 UTC (permalink / raw)
  To: kbuild-all

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

Hi Paul,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8006b911c90a4ec09958447d24c8a4c3538f5723
commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze 

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 >>):

>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
     408 | LSM_HOOK(int, 0, uring_sqpoll, void)
         |                  ^~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
     408 | LSM_HOOK(int, 0, uring_sqpoll, void)
         | ^~~~~~~~
>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
     407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
         |                  ^~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
     407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
     396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
         |                  ^~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
     396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
     392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
         |                  ^~~~~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
     392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
     390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
         |                  ^~~~~~~~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
     390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
     389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
         |                  ^~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
     389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
     388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
         |                  ^~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
     388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
     387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
         |                  ^~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
     387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
     382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
         |                  ^~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
         |                                ^~~~
   security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
     711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
     382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
         | ^~~~~~~~
   include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
     381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
         |                  ^~~~~~~~~~~~~~~~
   security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
     706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)


vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h

   405	
   406	#ifdef CONFIG_IO_URING
 > 407	LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
 > 408	LSM_HOOK(int, 0, uring_sqpoll, void)

---
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: 35092 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
  2021-10-13  8:16 ` kernel test robot
@ 2021-10-13 14:57   ` Paul Moore
  -1 siblings, 0 replies; 8+ messages in thread
From: Paul Moore @ 2021-10-13 14:57 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, Linux Memory Management List, linux-security-module

On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Paul,
>
> FYI, the error/warning still remains.

I'm not sure if anyone is monitoring the kernel test robot mail, but
this issue isn't unique to the LSM/audit/io_uring patches, it appears
to be a general LSM hook issue.

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
>
> 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 >>):
>
> >> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>          |                  ^~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>          | ^~~~~~~~
> >> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>          |                  ^~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>          |                  ^~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>          |                  ^~~~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>          |                  ^~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>          |                  ^~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>          |                  ^~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>          |                  ^~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
>          |                  ^~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>
>
> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
>
>    405
>    406  #ifdef CONFIG_IO_URING
>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



-- 
paul moore
www.paul-moore.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
@ 2021-10-13 14:57   ` Paul Moore
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Moore @ 2021-10-13 14:57 UTC (permalink / raw)
  To: kbuild-all

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

On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Paul,
>
> FYI, the error/warning still remains.

I'm not sure if anyone is monitoring the kernel test robot mail, but
this issue isn't unique to the LSM/audit/io_uring patches, it appears
to be a general LSM hook issue.

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
>
> 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 >>):
>
> >> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>          |                  ^~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>          | ^~~~~~~~
> >> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>          |                  ^~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>          |                  ^~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>          |                  ^~~~~~~~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>          |                  ^~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>          |                  ^~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>          |                  ^~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>          |                  ^~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>          |                                ^~~~
>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>          | ^~~~~~~~
>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
>          |                  ^~~~~~~~~~~~~~~~
>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>
>
> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
>
>    405
>    406  #ifdef CONFIG_IO_URING
>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org



-- 
paul moore
www.paul-moore.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
  2021-10-13 14:57   ` Paul Moore
@ 2021-10-13 15:52     ` Casey Schaufler
  -1 siblings, 0 replies; 8+ messages in thread
From: Casey Schaufler @ 2021-10-13 15:52 UTC (permalink / raw)
  To: Paul Moore, kernel test robot
  Cc: kbuild-all, Linux Memory Management List, linux-security-module,
	Casey Schaufler, KP Singh, Kees Cook

On 10/13/2021 7:57 AM, Paul Moore wrote:
> On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
>> Hi Paul,
>>
>> FYI, the error/warning still remains.
> I'm not sure if anyone is monitoring the kernel test robot mail, but
> this issue isn't unique to the LSM/audit/io_uring patches, it appears
> to be a general LSM hook issue.

Looks like fallout from KP Singh's MACRO stuff for BPF.

>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
>> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
>> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
>> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
>>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>         git fetch --no-tags linux-next master
>>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
>>         # save the attached .config to linux build tree
>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
>>
>> 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 >>):
>>
>>>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
>>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>>          |                  ^~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
>>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>>          | ^~~~~~~~
>>>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
>>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>          |                  ^~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
>>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
>>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>>          |                  ^~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
>>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
>>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>>          |                  ^~~~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
>>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
>>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>>          |                  ^~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
>>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
>>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>>          |                  ^~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
>>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
>>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>>          |                  ^~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
>>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
>>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>>          |                  ^~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
>>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
>>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
>>          |                  ^~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>
>>
>> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
>>
>>    405
>>    406  #ifdef CONFIG_IO_URING
>>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
@ 2021-10-13 15:52     ` Casey Schaufler
  0 siblings, 0 replies; 8+ messages in thread
From: Casey Schaufler @ 2021-10-13 15:52 UTC (permalink / raw)
  To: kbuild-all

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

On 10/13/2021 7:57 AM, Paul Moore wrote:
> On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
>> Hi Paul,
>>
>> FYI, the error/warning still remains.
> I'm not sure if anyone is monitoring the kernel test robot mail, but
> this issue isn't unique to the LSM/audit/io_uring patches, it appears
> to be a general LSM hook issue.

Looks like fallout from KP Singh's MACRO stuff for BPF.

>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
>> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
>> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
>> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
>>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>         git fetch --no-tags linux-next master
>>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
>>         # save the attached .config to linux build tree
>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
>>
>> 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 >>):
>>
>>>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
>>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>>          |                  ^~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
>>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
>>          | ^~~~~~~~
>>>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
>>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>          |                  ^~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
>>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
>>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>>          |                  ^~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
>>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
>>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
>>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>>          |                  ^~~~~~~~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
>>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
>>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>>          |                  ^~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
>>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
>>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>>          |                  ^~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
>>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
>>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>>          |                  ^~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
>>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
>>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>>          |                  ^~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>          |                                ^~~~
>>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
>>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
>>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
>>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
>>          | ^~~~~~~~
>>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
>>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
>>          |                  ^~~~~~~~~~~~~~~~
>>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
>>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
>>
>>
>> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
>>
>>    405
>>    406  #ifdef CONFIG_IO_URING
>>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
>>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
  2021-10-13 15:52     ` Casey Schaufler
@ 2021-10-13 17:23       ` Kees Cook
  -1 siblings, 0 replies; 8+ messages in thread
From: Kees Cook @ 2021-10-13 17:23 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: Paul Moore, kernel test robot, kbuild-all,
	Linux Memory Management List, linux-security-module, KP Singh

On Wed, Oct 13, 2021 at 08:52:15AM -0700, Casey Schaufler wrote:
> On 10/13/2021 7:57 AM, Paul Moore wrote:
> > On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
> >> Hi Paul,
> >>
> >> FYI, the error/warning still remains.
> > I'm not sure if anyone is monitoring the kernel test robot mail, but
> > this issue isn't unique to the LSM/audit/io_uring patches, it appears
> > to be a general LSM hook issue.
> 
> Looks like fallout from KP Singh's MACRO stuff for BPF.

Does this fix it?


diff --git a/security/security.c b/security/security.c
index 9ffa9e9c5c55..462f14354c2c 100644
--- a/security/security.c
+++ b/security/security.c
@@ -706,7 +706,7 @@ static int lsm_superblock_alloc(struct super_block *sb)
 #define LSM_RET_DEFAULT(NAME) (NAME##_default)
 #define DECLARE_LSM_RET_DEFAULT_void(DEFAULT, NAME)
 #define DECLARE_LSM_RET_DEFAULT_int(DEFAULT, NAME) \
-	static const int LSM_RET_DEFAULT(NAME) = (DEFAULT);
+	static const int __maybe_unused LSM_RET_DEFAULT(NAME) = (DEFAULT);
 #define LSM_HOOK(RET, DEFAULT, NAME, ...) \
 	DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
 

I will go try it...

-Kees

> 
> >
> >> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> >> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
> >> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
> >> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
> >> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
> >>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >>         git fetch --no-tags linux-next master
> >>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
> >>         # save the attached .config to linux build tree
> >>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
> >>
> >> 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 >>):
> >>
> >>>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
> >>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
> >>          |                  ^~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
> >>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
> >>          | ^~~~~~~~
> >>>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
> >>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
> >>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
> >>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
> >>          |                  ^~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
> >>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
> >>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
> >>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
> >>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
> >>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
> >>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
> >>          |                  ^~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
> >>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
> >>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
> >>          |                  ^~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
> >>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
> >>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
> >>          |                  ^~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
> >>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
> >>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
> >>          |                  ^~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
> >>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
> >>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
> >>          |                  ^~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>
> >>
> >> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
> >>
> >>    405
> >>    406  #ifdef CONFIG_IO_URING
> >>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
> >>
> >> ---
> >> 0-DAY CI Kernel Test Service, Intel Corporation
> >> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> >
> >
> 

-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used
@ 2021-10-13 17:23       ` Kees Cook
  0 siblings, 0 replies; 8+ messages in thread
From: Kees Cook @ 2021-10-13 17:23 UTC (permalink / raw)
  To: kbuild-all

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

On Wed, Oct 13, 2021 at 08:52:15AM -0700, Casey Schaufler wrote:
> On 10/13/2021 7:57 AM, Paul Moore wrote:
> > On Wed, Oct 13, 2021 at 4:17 AM kernel test robot <lkp@intel.com> wrote:
> >> Hi Paul,
> >>
> >> FYI, the error/warning still remains.
> > I'm not sure if anyone is monitoring the kernel test robot mail, but
> > this issue isn't unique to the LSM/audit/io_uring patches, it appears
> > to be a general LSM hook issue.
> 
> Looks like fallout from KP Singh's MACRO stuff for BPF.

Does this fix it?


diff --git a/security/security.c b/security/security.c
index 9ffa9e9c5c55..462f14354c2c 100644
--- a/security/security.c
+++ b/security/security.c
@@ -706,7 +706,7 @@ static int lsm_superblock_alloc(struct super_block *sb)
 #define LSM_RET_DEFAULT(NAME) (NAME##_default)
 #define DECLARE_LSM_RET_DEFAULT_void(DEFAULT, NAME)
 #define DECLARE_LSM_RET_DEFAULT_int(DEFAULT, NAME) \
-	static const int LSM_RET_DEFAULT(NAME) = (DEFAULT);
+	static const int __maybe_unused LSM_RET_DEFAULT(NAME) = (DEFAULT);
 #define LSM_HOOK(RET, DEFAULT, NAME, ...) \
 	DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
 

I will go try it...

-Kees

> 
> >
> >> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> >> head:   8006b911c90a4ec09958447d24c8a4c3538f5723
> >> commit: cdc1404a40461faba23c5a5ad40adcc7eecc1580 [1997/7806] lsm,io_uring: add LSM hooks to io_uring
> >> config: microblaze-buildonly-randconfig-r002-20211012 (attached as .config)
> >> compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdc1404a40461faba23c5a5ad40adcc7eecc1580
> >>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >>         git fetch --no-tags linux-next master
> >>         git checkout cdc1404a40461faba23c5a5ad40adcc7eecc1580
> >>         # save the attached .config to linux build tree
> >>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
> >>
> >> 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 >>):
> >>
> >>>> include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used [-Werror=unused-const-variable=]
> >>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
> >>          |                  ^~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:408:1: note: in expansion of macro 'LSM_HOOK'
> >>      408 | LSM_HOOK(int, 0, uring_sqpoll, void)
> >>          | ^~~~~~~~
> >>>> include/linux/lsm_hook_defs.h:407:18: error: 'uring_override_creds_default' defined but not used [-Werror=unused-const-variable=]
> >>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:407:1: note: in expansion of macro 'LSM_HOOK'
> >>      407 | LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:396:18: error: 'locked_down_default' defined but not used [-Werror=unused-const-variable=]
> >>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
> >>          |                  ^~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:396:1: note: in expansion of macro 'LSM_HOOK'
> >>      396 | LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:392:18: error: 'bpf_prog_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
> >>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:392:1: note: in expansion of macro 'LSM_HOOK'
> >>      392 | LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:390:18: error: 'bpf_map_alloc_security_default' defined but not used [-Werror=unused-const-variable=]
> >>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
> >>          |                  ^~~~~~~~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:390:1: note: in expansion of macro 'LSM_HOOK'
> >>      390 | LSM_HOOK(int, 0, bpf_map_alloc_security, struct bpf_map *map)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:389:18: error: 'bpf_prog_default' defined but not used [-Werror=unused-const-variable=]
> >>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
> >>          |                  ^~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:389:1: note: in expansion of macro 'LSM_HOOK'
> >>      389 | LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:388:18: error: 'bpf_map_default' defined but not used [-Werror=unused-const-variable=]
> >>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
> >>          |                  ^~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:388:1: note: in expansion of macro 'LSM_HOOK'
> >>      388 | LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:387:18: error: 'bpf_default' defined but not used [-Werror=unused-const-variable=]
> >>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
> >>          |                  ^~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:387:1: note: in expansion of macro 'LSM_HOOK'
> >>      387 | LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:382:18: error: 'audit_rule_match_default' defined but not used [-Werror=unused-const-variable=]
> >>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
> >>          |                  ^~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>          |                                ^~~~
> >>    security/security.c:711:9: note: in expansion of macro 'DECLARE_LSM_RET_DEFAULT_int'
> >>      711 |         DECLARE_LSM_RET_DEFAULT_##RET(DEFAULT, NAME)
> >>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >>    include/linux/lsm_hook_defs.h:382:1: note: in expansion of macro 'LSM_HOOK'
> >>      382 | LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule)
> >>          | ^~~~~~~~
> >>    include/linux/lsm_hook_defs.h:381:18: error: 'audit_rule_known_default' defined but not used [-Werror=unused-const-variable=]
> >>      381 | LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule)
> >>          |                  ^~~~~~~~~~~~~~~~
> >>    security/security.c:706:32: note: in definition of macro 'LSM_RET_DEFAULT'
> >>      706 | #define LSM_RET_DEFAULT(NAME) (NAME##_default)
> >>
> >>
> >> vim +/uring_sqpoll_default +408 include/linux/lsm_hook_defs.h
> >>
> >>    405
> >>    406  #ifdef CONFIG_IO_URING
> >>  > 407  LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
> >>  > 408  LSM_HOOK(int, 0, uring_sqpoll, void)
> >>
> >> ---
> >> 0-DAY CI Kernel Test Service, Intel Corporation
> >> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> >
> >
> 

-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-13 17:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  8:16 [linux-next:master 1997/7806] include/linux/lsm_hook_defs.h:408:18: error: 'uring_sqpoll_default' defined but not used kernel test robot
2021-10-13  8:16 ` kernel test robot
2021-10-13 14:57 ` Paul Moore
2021-10-13 14:57   ` Paul Moore
2021-10-13 15:52   ` Casey Schaufler
2021-10-13 15:52     ` Casey Schaufler
2021-10-13 17:23     ` Kees Cook
2021-10-13 17:23       ` Kees Cook

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.