linux-headers make kernel script fails with fatal error: classmap.h: No such file or directory

Bug #1986378 reported by Jiandi An
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

It looks like in most Ubuntu Linux kernel, building kernel scripts
in /usr/scr/linux-headers-$(uname -r)/ fails with classmap.h missing.
The security/selinux/include/ headers are not included in /usr/src to be packaged in linux-source-x.xx_xxx.deb package.

CONFIG_SECURITY_SELINUX is enabled.

lab@test-server:/usr/src/linux-headers-5.15.0-43-generic$ zgrep CONFIG_SECURITY_SELINUX /boot/config-$(uname -r)
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
# CONFIG_SECURITY_SELINUX_DISABLE is not set
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9
CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256

lab@test-server:/usr/src/linux-headers-5.15.0-43-generic$ sudo make scripts
[sudo] password for lab:
  SYNC include/config/auto.conf.cmd
  HOSTCC scripts/basic/fixdep
  HOSTCC scripts/kconfig/conf.o
  HOSTCC scripts/kconfig/confdata.o
  HOSTCC scripts/kconfig/expr.o
  LEX scripts/kconfig/lexer.lex.c
  YACC scripts/kconfig/parser.tab.[ch]
  HOSTCC scripts/kconfig/lexer.lex.o
  HOSTCC scripts/kconfig/menu.o
  HOSTCC scripts/kconfig/parser.tab.o
  HOSTCC scripts/kconfig/preprocess.o
  HOSTCC scripts/kconfig/symbol.o
  HOSTCC scripts/kconfig/util.o
  HOSTLD scripts/kconfig/conf
6^[[18~ HOSTCC scripts/genksyms/genksyms.o
  YACC scripts/genksyms/parse.tab.[ch]
  HOSTCC scripts/genksyms/parse.tab.o
  LEX scripts/genksyms/lex.lex.c
  HOSTCC scripts/genksyms/lex.lex.o
  HOSTLD scripts/genksyms/genksyms
  HOSTCC scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      | ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:95: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:548: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:548: scripts/selinux] Error 2
make: *** [Makefile:1209: scripts] Error 2
lab@test-server:/usr/src/linux-headers-5.15.0-43-generic$

lab@test-server:~$ uname -a
Linux test-server 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
lab@test-server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
lab@test-server:~$ cat /proc/version_signature
Ubuntu 5.15.0-43.46-generic 5.15.39

Should security/selinux/include/ headers be shipped in /usr/src/ as part of linux-source-x.xx.x_xxxx.deb or is there other proper workaround for this issue?

I've tried with the following kernels:
Ubuntu 20.04 5.4.0-120-generic amd64 kernel
Ubuntu 20.04 5.4.0-64-generic arm64 kernel
Ubuntu 22.04 5.15.0-43-generic amd64 kernel
Ubuntu 20.04 custom build arm64 Ubuntu-unstable-5.17.0-6.6 from Ubuntu-unstable kernel tree

An old Debian Bug report
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988367
where they have a fix to copy the selinux headers to /usr/src to ship
https://github.com/ilbers/isar/pull/67
https://github.com/ilbers/isar/pull/67/commits/7818e4f5e7495961c172511648476f5bf1c2e0fc

Thanks
- Jiandi
---
ProblemType: Bug
AlsaDevices:
 total 0
 crw-rw----+ 1 root audio 116, 1 Aug 9 12:12 seq
 crw-rw----+ 1 root audio 116, 33 Aug 9 12:12 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CRDA: N/A
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2022-08-09 (3 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220421)
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
MachineType: To be filled by O.E.M. To be filled by O.E.M.
Package: linux (not installed)
PciMultimedia:

ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 astdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.15.0-43-generic root=UUID=e3d8adf4-67b0-4bac-8472-7eaebbb8cb7d ro transparent_hugepage=madvise console=tty0 console=ttyS1,115200n8 pci=realloc=off crashkernel=1G-:0M
ProcVersionSignature: Ubuntu 5.15.0-43.46-generic 5.15.39
RelatedPackageVersions:
 linux-restricted-modules-5.15.0-43-generic N/A
 linux-backports-modules-5.15.0-43-generic N/A
 linux-firmware 20220329.git681281e4-0ubuntu3.3
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
Tags: jammy uec-images
Uname: Linux 5.15.0-43-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 10/06/2021
dmi.bios.release: 0.2
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0.02
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: To be filled by O.E.M.
dmi.board.vendor: To be filled by O.E.M.
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: To be filled by O.E.M.
dmi.chassis.type: 2
dmi.chassis.vendor: To be filled by O.E.M.
dmi.chassis.version: To be filled by O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0.02:bd10/06/2021:br0.2:svnTobefilledbyO.E.M.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnTobefilledbyO.E.M.:ct2:cvrTobefilledbyO.E.M.:skuDefaultstring:
dmi.product.family: DGXA100
dmi.product.name: To be filled by O.E.M.
dmi.product.sku: Default string
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: To be filled by O.E.M.

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 1986378

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
Jiandi An (jiandi)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jiandi An (jiandi) wrote : CurrentDmesg.txt

apport information

tags: added: apport-collected jammy uec-images
description: updated
Revision history for this message
Jiandi An (jiandi) wrote : HookError_ubuntu.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : Lspci.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : Lspci-vt.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : Lsusb.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : Lsusb-t.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : Lsusb-v.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : ProcModules.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : UdevDb.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : WifiSyslog.txt

apport information

Revision history for this message
Jiandi An (jiandi) wrote : acpidump.txt

apport information

Revision history for this message
Vladislav (azarovvlad) wrote :

same bug on Ubuntu 22.10
5.19.0-1011-raspi #18-Ubuntu SMP PREEMPT Thu Dec 15 11:27:47 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

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.