2019-09-24 16:46:31

by zhong jiang

[permalink] [raw]
Subject: [PATCH] smack: fix an compile error in smack_post_notification

I hit the following error when compile the kernel.

security/smack/smack_lsm.c: In function smack_post_notification:
security/smack/smack_lsm.c:4383:7: error: dereferencing pointer to incomplete type struct watch_notification
if (n->type == WATCH_TYPE_META)
^~
security/smack/smack_lsm.c:4383:17: error: WATCH_TYPE_META undeclared (first use in this function); did you mean TCA_PIE_BETA?
if (n->type == WATCH_TYPE_META)
^~~~~~~~~~~~~~~
TCA_PIE_BETA
security/smack/smack_lsm.c:4383:17: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: zhong jiang <[email protected]>
---
security/smack/smack.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/security/smack/smack.h b/security/smack/smack.h
index 62529f3..02b05a2 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -21,6 +21,7 @@
#include <linux/rculist.h>
#include <linux/lsm_audit.h>
#include <linux/msg.h>
+#include <linux/watch_queue.h>

/*
* Use IPv6 port labeling if IPv6 is enabled and secmarks
--
1.7.12.4


2019-09-25 04:09:08

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] smack: fix an compile error in smack_post_notification

Hi zhong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3 next-20190920]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/zhong-jiang/smack-fix-an-compile-error-in-smack_post_notification/20190923-112403
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from security/smack/smack_lsm.c:45:0:
>> security/smack/smack.h:24:10: fatal error: linux/watch_queue.h: No such file or directory
#include <linux/watch_queue.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

vim +24 security/smack/smack.h

11
12 #include <linux/capability.h>
13 #include <linux/spinlock.h>
14 #include <linux/lsm_hooks.h>
15 #include <linux/in.h>
16 #if IS_ENABLED(CONFIG_IPV6)
17 #include <linux/in6.h>
18 #endif /* CONFIG_IPV6 */
19 #include <net/netlabel.h>
20 #include <linux/list.h>
21 #include <linux/rculist.h>
22 #include <linux/lsm_audit.h>
23 #include <linux/msg.h>
> 24 #include <linux/watch_queue.h>
25

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.73 kB)
.config.gz (68.41 kB)
Download all attachments

2019-09-26 00:09:08

by Casey Schaufler

[permalink] [raw]
Subject: Re: [PATCH] smack: fix an compile error in smack_post_notification

On 9/22/2019 8:16 PM, zhong jiang wrote:
> I hit the following error when compile the kernel.

What tree/branch are you working with? I don't see this.

>
> security/smack/smack_lsm.c: In function smack_post_notification:
> security/smack/smack_lsm.c:4383:7: error: dereferencing pointer to incomplete type struct watch_notification
> if (n->type == WATCH_TYPE_META)
> ^~
> security/smack/smack_lsm.c:4383:17: error: WATCH_TYPE_META undeclared (first use in this function); did you mean TCA_PIE_BETA?
> if (n->type == WATCH_TYPE_META)
> ^~~~~~~~~~~~~~~
> TCA_PIE_BETA
> security/smack/smack_lsm.c:4383:17: note: each undeclared identifier is reported only once for each function it appears in
>
> Signed-off-by: zhong jiang <[email protected]>
> ---
> security/smack/smack.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/security/smack/smack.h b/security/smack/smack.h
> index 62529f3..02b05a2 100644
> --- a/security/smack/smack.h
> +++ b/security/smack/smack.h
> @@ -21,6 +21,7 @@
> #include <linux/rculist.h>
> #include <linux/lsm_audit.h>
> #include <linux/msg.h>
> +#include <linux/watch_queue.h>
>
> /*
> * Use IPv6 port labeling if IPv6 is enabled and secmarks