Linker warnings for apparmor.o

Bug #1729634 reported by Arvan David Pritchard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apparmor (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Building the Ubuntu kernel at version 4.4.0-97.120 or 4.4.0-98.121 gives warnings when linking apparmor.o such as:

  LD security/apparmor/apparmor.o
WARNING: security/apparmor/apparmor.o(.text+0x1087b): Section mismatch in reference from the function param_get_mode() to the variable .init.data:apparmor_initialized
(next build fault)
The function param_get_mode() references
the variable __initdata apparmor_initialized.
This is often because param_get_mode lacks a __initdata
annotation or the annotation of apparmor_initialized is wrong.

I believe this is because the __initdata annotation was removed from security/apparmor/lsm.c but not from security/apparmor/include/lib.h

The following patch cleans the compilation warnings, but may not be the correct fix:

--- security/apparmor/include/lib.h.orig 2017-11-02 14:43:59.903230945 +0000
+++ security/apparmor/include/lib.h 2017-11-02 14:44:57.992635353 +0000
@@ -56,7 +56,7 @@
        } while (0)

 /* Flag indicating whether initialization completed */
-extern int apparmor_initialized __initdata;
+extern int apparmor_initialized;

 /* fn's in lib */
 char *aa_split_fqname(char *args, char **ns_name);

Revision history for this message
Arvan David Pritchard (arvan-pritchard) wrote :
Revision history for this message
Arvan David Pritchard (arvan-pritchard) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1729634

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Arvan David Pritchard (arvan-pritchard) wrote : Re: Linker warnings for apparmor.h

Cannot run
apport-collect 1729634

This bug is related to building the kernel for an appliance which does not have apport installed, and the build is done on a headless system accessed over ssh.

I tried to run apport-collect there but could not work out how to log into launchpad via the terminal-based web browser.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Arvan David Pritchard (arvan-pritchard) wrote :

Set status to confirmed as requested in email from Ubuntu Kernel Bot

summary: - Linker warnings for apparmor.h
+ Linker warnings for apparmor.o
affects: linux (Ubuntu) → apparmor (Ubuntu)
Changed in apparmor (Ubuntu):
status: Confirmed → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apparmor (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.