Skip to contentSkip to conversation

ima changes to shmem breaks !CONFIG_SHMEM

DISCUSSION Mike Frysinger 4 participants 7 messages Feb 9, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used. -mike

#1 lore raw
Quoted 9 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Does this seem like the correct fix?

---

mm/shmem.c +1 -1
index 7519988..8135fac 100644
@@ -28,6 +28,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/swap.h>
+#include <linux/ima.h>
 
 static struct vfsmount *shm_mnt;
 
@@ -59,7 +60,6 @@ static struct vfsmount *shm_mnt;
 #include <linux/highmem.h>
 #include <linux/seq_file.h>
 #include <linux/magic.h>
-#include <linux/ima.h>
 
 #include <asm/uaccess.h>
 #include <asm/div64.h>
#2 lore raw
Quoted 8 lines · James Morris
Quoted 7 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

Quoted 4 lines
Quoted 2 lines

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Does this seem like the correct fix?

it converts the build error to a build warning:
CC mm/shmem.o
In file included from mm/shmem.c:32:
include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside parameter list
include/linux/ima.h:25: warning: its scope is only this definition or declaration, which is probably not what you want
-mike

#3 lore raw
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · James Morris
Quoted 9 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Does this seem like the correct fix?

Quoted 7 lines

it converts the build error to a build warning:
CC mm/shmem.o
In file included from mm/shmem.c:32:
include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside parameter list
include/linux/ima.h:25: warning: its scope is only this definition or declaration, which is probably not what you want

Add to the other patch:

include/linux/ima.h +1 -0
@@ -8,6 +8,7 @@
  */
 
 #include <linux/fs.h>
+struct linux_binprm;
 
 #ifndef _LINUX_IMA_H
 #define _LINUX_IMA_H

and it builds for me.

Signature · 1 line
~Randy
#4 lore raw
Quoted 37 lines · Randy Dunlap
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · James Morris
Quoted 9 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Does this seem like the correct fix?

Quoted 7 lines

it converts the build error to a build warning:
CC mm/shmem.o
In file included from mm/shmem.c:32:
include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside parameter list
include/linux/ima.h:25: warning: its scope is only this definition or declaration, which is probably not what you want

Add to the other patch:

include/linux/ima.h +1 -0
@@ -8,6 +8,7 @@
 */
 
 #include <linux/fs.h>
+struct linux_binprm;
 
 #ifndef _LINUX_IMA_H
 #define _LINUX_IMA_H
Quoted 1 line

and it builds for me.

yes, it builds w/out warnings now for me too. any reason those are outside of _LINUX_IMA_H ? looks like they should both be inside of that.
-mike

#5 lore raw
Quoted 36 lines · Mike Frysinger
Quoted 35 lines · Randy Dunlap
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · James Morris
Quoted 9 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Quoted 8 lines
Quoted 1 line

Does this seem like the correct fix?

it converts the build error to a build warning:
CC mm/shmem.o
In file included from mm/shmem.c:32:
include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside parameter list
include/linux/ima.h:25: warning: its scope is only this definition or declaration, which is probably not what you want

Add to the other patch:

include/linux/ima.h +1 -0
@@ -8,6 +8,7 @@
 */
 
 #include <linux/fs.h>
+struct linux_binprm;
 
 #ifndef _LINUX_IMA_H
 #define _LINUX_IMA_H
Quoted 5 lines
Quoted 1 line

and it builds for me.

yes, it builds w/out warnings now for me too. any reason those are outside of _LINUX_IMA_H ? looks like they should both be inside of that.

Agreed, that change is also good.

Thanks.

Signature · 1 line
~Randy
#6 lore raw
Quoted 43 lines · Randy Dunlap
Quoted 36 lines · Mike Frysinger
Quoted 35 lines · Randy Dunlap
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · James Morris
Quoted 9 lines · Mike Frysinger

commit 1df9f0a73178718969ae47d813b8e7aab2cf073c broke default building for Blackfin systems:
CC mm/shmem.o
mm/shmem.c: In function 'shmem_zero_setup':
mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check' make[1]: *** [mm/shmem.o] Error 1

that's because the ima.h include was added behind the CONFIG_SHMEM markings rather than everywhere, just like the function is used.

Quoted 8 lines
Quoted 1 line

Does this seem like the correct fix?

it converts the build error to a build warning:
CC mm/shmem.o
In file included from mm/shmem.c:32:
include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside parameter list
include/linux/ima.h:25: warning: its scope is only this definition or declaration, which is probably not what you want

Add to the other patch:

include/linux/ima.h +1 -0
@@ -8,6 +8,7 @@
 */
 
 #include <linux/fs.h>
+struct linux_binprm;
 
 #ifndef _LINUX_IMA_H
 #define _LINUX_IMA_H
Quoted 5 lines
Quoted 1 line

and it builds for me.

yes, it builds w/out warnings now for me too. any reason those are outside of _LINUX_IMA_H ? looks like they should both be inside of that.

Quoted 4 lines

Agreed, that change is also good.

Thanks.

I posted the patch, forgetting to copy both Mike and you. Could you please verify the patch resolves the problem.

Thanks!

Mimi