diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-02-10 18:13:51 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-02-12 09:16:07 -0800 |
| commit | efc0b522c15f102e1ceeb52940d6932032f1ecb4 (patch) | |
| tree | d7830fefd2d5edfa60a7b3c36108d73c448ff2bf | |
| parent | c5199e0925c9eef1cae99625ee196a61ca137d76 (diff) | |
| download | meta-openembedded-efc0b522c15f102e1ceeb52940d6932032f1ecb4.tar.gz | |
nmap: fix racing issue at do_compile
There are two build-lua rules, one in Makefile.in, another in
ncat/Makefile.in which is required by build-ncat
Build them may cause potential racing
$ bitbake lib32-nmap
$ grep -e "Compiling liblua" -e 'nmap-7.95/liblua' -e ": error" -n patch-to/temp/log.do_compile
Compiling liblua
make[1]: Entering directory 'path-to/build/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
Compiling liblua
make[2]: Entering directory 'path-to/build/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
make[2]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/recipe-sysroot-native/usr/bin/i686-wrsmllib32-linux/../../libexec/i686-wrsmllib32-linux/gcc/i686-wrsmllib32-linux/14.2.0/ld: ./../liblua/liblua.a: error adding symbols: no more archived files
collect2: error: ld returned 1 exit status
make[1]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
Explicitly make build-ncat depends on build-lua to avoid racing,
after applying the patch
...
Compiling liblua
make[1]: Entering directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
make[1]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
Compiling liblua
make[2]: Entering directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
make[2]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua'
...
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-security/nmap/files/0001-fix-racing-between-build-ncat-and-build-lua.patch | 55 | ||||
| -rw-r--r-- | meta-oe/recipes-security/nmap/nmap_7.95.bb | 1 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta-oe/recipes-security/nmap/files/0001-fix-racing-between-build-ncat-and-build-lua.patch b/meta-oe/recipes-security/nmap/files/0001-fix-racing-between-build-ncat-and-build-lua.patch new file mode 100644 index 0000000000..aad8b1ee92 --- /dev/null +++ b/meta-oe/recipes-security/nmap/files/0001-fix-racing-between-build-ncat-and-build-lua.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From 0cde425abfcacdde725dccff29d01c9fce7c3888 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Sun, 9 Feb 2025 00:45:36 +0000 | ||
| 4 | Subject: [PATCH] fix racing between build-ncat and build-lua | ||
| 5 | |||
| 6 | There are two build-lua rules, one in Makefile.in, another in | ||
| 7 | ncat/Makefile.in which is required by build-ncat | ||
| 8 | |||
| 9 | Build them may cause potential racing | ||
| 10 | |||
| 11 | $ bitbake lib32-nmap | ||
| 12 | $ grep -e "Compiling liblua" -e 'nmap-7.95/liblua' -e ": error" -n patch-to/temp/log.do_compile | ||
| 13 | Compiling liblua | ||
| 14 | make[1]: Entering directory 'path-to/build/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 15 | Compiling liblua | ||
| 16 | make[2]: Entering directory 'path-to/build/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 17 | make[2]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 18 | path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/recipe-sysroot-native/usr/bin/i686-wrsmllib32-linux/../../libexec/i686-wrsmllib32-linux/gcc/i686-wrsmllib32-linux/14.2.0/ld: ./../liblua/liblua.a: error adding symbols: no more archived files | ||
| 19 | collect2: error: ld returned 1 exit status | ||
| 20 | make[1]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 21 | |||
| 22 | Explicitly make build-ncat depends on build-lua to avoid racing, | ||
| 23 | after applying the patch | ||
| 24 | ... | ||
| 25 | Compiling liblua | ||
| 26 | make[1]: Entering directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 27 | make[1]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 28 | Compiling liblua | ||
| 29 | make[2]: Entering directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 30 | make[2]: Leaving directory 'path-to/tmp/work/corei7-32-wrsmllib32-linux/lib32-nmap/7.95/nmap-7.95/liblua' | ||
| 31 | ... | ||
| 32 | |||
| 33 | Upstream-Status: Submitted [https://github.com/nmap/nmap/pull/3025] | ||
| 34 | |||
| 35 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 36 | --- | ||
| 37 | Makefile.in | 2 +- | ||
| 38 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 39 | |||
| 40 | diff --git a/Makefile.in b/Makefile.in | ||
| 41 | index e2f79c9..0e634a3 100644 | ||
| 42 | --- a/Makefile.in | ||
| 43 | +++ b/Makefile.in | ||
| 44 | @@ -159,7 +159,7 @@ build-netutil: libnetutil/Makefile | ||
| 45 | @echo Compiling libnetutil; | ||
| 46 | cd libnetutil && $(MAKE) | ||
| 47 | |||
| 48 | -build-ncat: $(NCATDIR)/Makefile build-nbase build-nsock $(NCATDIR)/ncat.h @PCAP_BUILD@ | ||
| 49 | +build-ncat: $(NCATDIR)/Makefile build-nbase build-nsock build-lua $(NCATDIR)/ncat.h @PCAP_BUILD@ | ||
| 50 | cd $(NCATDIR) && $(MAKE) | ||
| 51 | |||
| 52 | build-lua: $(LIBLUADIR)/Makefile | ||
| 53 | -- | ||
| 54 | 2.47.1 | ||
| 55 | |||
diff --git a/meta-oe/recipes-security/nmap/nmap_7.95.bb b/meta-oe/recipes-security/nmap/nmap_7.95.bb index a319be4fb0..f165e47bf5 100644 --- a/meta-oe/recipes-security/nmap/nmap_7.95.bb +++ b/meta-oe/recipes-security/nmap/nmap_7.95.bb | |||
| @@ -11,6 +11,7 @@ SRC_URI = "http://nmap.org/dist/${BP}.tar.bz2 \ | |||
| 11 | file://0001-Include-time.h-header-to-pass-clang-compilation.patch \ | 11 | file://0001-Include-time.h-header-to-pass-clang-compilation.patch \ |
| 12 | file://0002-Fix-building-with-libc.patch \ | 12 | file://0002-Fix-building-with-libc.patch \ |
| 13 | file://0003-Fix-off-by-one-overflow-in-the-IP-protocol-table.patch \ | 13 | file://0003-Fix-off-by-one-overflow-in-the-IP-protocol-table.patch \ |
| 14 | file://0001-fix-racing-between-build-ncat-and-build-lua.patch \ | ||
| 14 | " | 15 | " |
| 15 | SRC_URI[sha256sum] = "e14ab530e47b5afd88f1c8a2bac7f89cd8fe6b478e22d255c5b9bddb7a1c5778" | 16 | SRC_URI[sha256sum] = "e14ab530e47b5afd88f1c8a2bac7f89cd8fe6b478e22d255c5b9bddb7a1c5778" |
| 16 | inherit autotools-brokensep pkgconfig python3native | 17 | inherit autotools-brokensep pkgconfig python3native |
