Linux-Security-Module Archive on lore.kernel.org
 help / Atom feed
* [PATCH] apparmor: fix build error undefined reference to zlib_*
@ 2019-02-12  9:48 Anders Roxell
  2019-02-12 10:53 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Roxell @ 2019-02-12  9:48 UTC (permalink / raw)
  To: john.johansen, jmorris, serge
  Cc: linux-security-module, linux-kernel, Anders Roxell

With commit 876dd866c084 ("apparmor: Initial implementation of raw
policy blob compression") and SECURITY_APPARMOR is set to '=y'
ZLIB_DEFLATE must be enabled as well for the linker to see the symbols.

aarch64-linux-gnu-ld: security/apparmor/policy_unpack.o: in function `deflate_compress':
../security/apparmor/policy_unpack.c:1030: undefined reference to `zlib_deflate_workspacesize'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1030:(.text+0xe20): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflate_workspacesize'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1036: undefined reference to `zlib_deflateInit2'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1036:(.text+0xe60): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateInit2'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1053: undefined reference to `zlib_deflate'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1053:(.text+0xec0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflate'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xf90): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xfb4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xfd8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
make[1]: *** [Makefile:1023: vmlinux] Error 1
make[1]: Target 'Image' not remade because of errors.
make: *** [Makefile:152: sub-make] Error 2
make: Target 'Image' not remade because of errors.

Rework so when SECURITY_APPARMOR is set to '=y' ZLIB_INFLATE and ZLIB_DEFLATE gets
selected, since both are used by the SECURITY_APPARMOR.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 security/apparmor/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/apparmor/Kconfig b/security/apparmor/Kconfig
index 3de21f46c82a..99c35e22c119 100644
--- a/security/apparmor/Kconfig
+++ b/security/apparmor/Kconfig
@@ -5,6 +5,8 @@ config SECURITY_APPARMOR
 	select SECURITY_PATH
 	select SECURITYFS
 	select SECURITY_NETWORK
+	select ZLIB_INFLATE
+	select ZLIB_DEFLATE
 	default n
 	help
 	  This enables the AppArmor security module.
-- 
2.20.1


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

* Re: [PATCH] apparmor: fix build error undefined reference to zlib_*
  2019-02-12  9:48 [PATCH] apparmor: fix build error undefined reference to zlib_* Anders Roxell
@ 2019-02-12 10:53 ` John Johansen
  0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2019-02-12 10:53 UTC (permalink / raw)
  To: Anders Roxell, jmorris, serge; +Cc: linux-security-module, linux-kernel

On 2/12/19 1:48 AM, Anders Roxell wrote:
> With commit 876dd866c084 ("apparmor: Initial implementation of raw
> policy blob compression") and SECURITY_APPARMOR is set to '=y'
> ZLIB_DEFLATE must be enabled as well for the linker to see the symbols.
> 
> aarch64-linux-gnu-ld: security/apparmor/policy_unpack.o: in function `deflate_compress':
> ../security/apparmor/policy_unpack.c:1030: undefined reference to `zlib_deflate_workspacesize'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1030:(.text+0xe20): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflate_workspacesize'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1036: undefined reference to `zlib_deflateInit2'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1036:(.text+0xe60): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateInit2'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1053: undefined reference to `zlib_deflate'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1053:(.text+0xec0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflate'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xf90): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xfb4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081: undefined reference to `zlib_deflateEnd'
> aarch64-linux-gnu-ld: ../security/apparmor/policy_unpack.c:1081:(.text+0xfd8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `zlib_deflateEnd'
> make[1]: *** [Makefile:1023: vmlinux] Error 1
> make[1]: Target 'Image' not remade because of errors.
> make: *** [Makefile:152: sub-make] Error 2
> make: Target 'Image' not remade because of errors.
> 
> Rework so when SECURITY_APPARMOR is set to '=y' ZLIB_INFLATE and ZLIB_DEFLATE gets
> selected, since both are used by the SECURITY_APPARMOR.
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

yep thanks for the patch,

unfortunately this same fix landed in apparmor-next about 5 hours ago

> ---
>  security/apparmor/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/security/apparmor/Kconfig b/security/apparmor/Kconfig
> index 3de21f46c82a..99c35e22c119 100644
> --- a/security/apparmor/Kconfig
> +++ b/security/apparmor/Kconfig
> @@ -5,6 +5,8 @@ config SECURITY_APPARMOR
>  	select SECURITY_PATH
>  	select SECURITYFS
>  	select SECURITY_NETWORK
> +	select ZLIB_INFLATE
> +	select ZLIB_DEFLATE
>  	default n
>  	help
>  	  This enables the AppArmor security module.
> 


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12  9:48 [PATCH] apparmor: fix build error undefined reference to zlib_* Anders Roxell
2019-02-12 10:53 ` John Johansen

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org linux-security-module@archiver.kernel.org
	public-inbox-index linux-security-module


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/ public-inbox