lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUVW2X6G=qukJTrZuUevcnrOiuShJGxnxVaqyONNxv+RYg@mail.gmail.com>
Date:   Mon, 8 Apr 2019 15:36:22 +0200
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     Denys Vlasenko <dvlasenk@...hat.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org
Subject: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

Hi Denys,

I fell over your commit "crypto: x86 - make constants readonly, allow
linker to merge them" [1] while digging into ClangBuiltLinux issue 431
[0].

I see the following in my dmesg-log:

$ grep sysfs: dmesg_5.0.4-rc1-1-amd64-cbl-asmgoto.txt
[Fri Mar 22 10:32:09 2019] sysfs: cannot create duplicate filename
'/module/usbcore/sections/.rodata.cst16'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/nfsd/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/iwlwifi/sections/.rodata.cst16'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/i915/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/mac80211/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/iwlmvm/sections/.rodata.cst16'
[Fri Mar 22 10:32:20 2019] sysfs: cannot create duplicate filename
'/module/bluetooth/sections/.rodata.cst16'

Above modules have dependencies to stuff from arch/x86/crypto (see below P.S.).

Looks like LLD defaults to -ffunction-sections and -fdata-sections.
Do you happen to know what the defaults are for BFD linker?

LLD maintainers suggest me to put -fdata-sections.
But where?

I tried to put it into arch/86/Makefile:

KBUILD_CFLAGS_MODULE += -fdata-sections

No success.
Not sure if I need also to activate -ffunction-sections in this line.

Unsure if this is too aggressive...

diff --git a/Makefile b/Makefile
index ac29cd533d55..08bd1946e182 100644
--- a/Makefile
+++ b/Makefile
@@ -815,6 +815,8 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
 KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
 LDFLAGS_vmlinux += --gc-sections
 endif
+KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
+KBUILD_CFLAGS_MODULE += -ffunction-sections -fdata-sections

 # arch Makefile may override CC so keep this after arch Makefile is included
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)

...and what about the correlation with this setting init/Makefile...

ccflags-y := -fno-function-sections -fno-data-sections

More details see [0].

Maybe you have an idea?
If you need further informations, please let me know.

Thanks in advance.

Regards,
- Sedat -

[0] https://github.com/ClangBuiltLinux/linux/issues/431
[1] https://git.kernel.org/linus/e183914af00e15eb41ae666d44e323bfa154be13

P.S.: arch/x86/crypto dependencies

$ git grep -E 'rodata.cst16|rodata.cst32' | grep arch/x86
arch/x86/crypto/aegis128-aesni-asm.S:.section
.rodata.cst16.aegis128_const, "aM", @progbits, 32
arch/x86/crypto/aegis128-aesni-asm.S:.section
.rodata.cst16.aegis128_counter, "aM", @progbits, 16
arch/x86/crypto/aegis128l-aesni-asm.S:.section
.rodata.cst16.aegis128l_const, "aM", @progbits, 32
arch/x86/crypto/aegis128l-aesni-asm.S:.section
.rodata.cst16.aegis128l_counter, "aM", @progbits, 16
arch/x86/crypto/aegis256-aesni-asm.S:.section
.rodata.cst16.aegis256_const, "aM", @progbits, 32
arch/x86/crypto/aegis256-aesni-asm.S:.section
.rodata.cst16.aegis256_counter, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.gf128mul_x_ble_mask, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.POLY,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.TWOONE,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.MASK1,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.MASK2,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.ONE,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.F_MIN_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.dec,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section      .rodata.cst16.enc,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.POLY, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.POLY2, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.TWOONE, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.ONE, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.ONEf, "aM", @progbits, 16
arch/x86/crypto/camellia-aesni-avx-asm_64.S:.section    .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.shufb_16x16b, "aM", @progbits, 32
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.pack_bswap, "aM", @progbits, 32
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section   .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap_mask, "aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap_iv_mask, "aM", @progbits, 16
arch/x86/crypto/cast6-avx-x86_64-asm_64.S:.section      .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/chacha-avx2-x86_64.S:.section   .rodata.cst32.ROT8,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section   .rodata.cst32.ROT16,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section   .rodata.cst32.CTRINC,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section   .rodata.cst32.CTR2BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section   .rodata.cst32.CTR4BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR2BL, "aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR4BL, "aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR8BL, "aM", @progbits, 32
arch/x86/crypto/chacha-ssse3-x86_64.S:.section  .rodata.cst16.ROT8,
"aM", @progbits, 16
arch/x86/crypto/chacha-ssse3-x86_64.S:.section  .rodata.cst16.ROT16,
"aM", @progbits, 16
arch/x86/crypto/chacha-ssse3-x86_64.S:.section  .rodata.cst16.CTRINC,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section .rodata.cst16.mask1,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section .rodata.cst16.mask2,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section
.rodata.cst32.pshufb_shf_table, "aM", @progbits, 32
arch/x86/crypto/ghash-clmulni-intel_asm.S:.section
.rodata.cst16.bswap_mask, "aM", @progbits, 16
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_const, "aM", @progbits, 32
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_counter, "aM", @progbits, 32
arch/x86/crypto/morus1280-sse2-asm.S:.section
.rodata.cst16.morus640_const, "aM", @progbits, 16
arch/x86/crypto/morus1280-sse2-asm.S:.section
.rodata.cst16.morus640_counter, "aM", @progbits, 16
arch/x86/crypto/morus640-sse2-asm.S:.section
.rodata.cst16.morus640_const, "aM", @progbits, 32
arch/x86/crypto/morus640-sse2-asm.S:.section
.rodata.cst16.morus640_counter, "aM", @progbits, 16
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ANMASK,
"aM", @progbits, 32
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ORMASK,
"aM", @progbits, 32
arch/x86/crypto/poly1305-sse2-x86_64.S:.section .rodata.cst16.ANMASK,
"aM", @progbits, 16
arch/x86/crypto/poly1305-sse2-x86_64.S:.section .rodata.cst16.ORMASK,
"aM", @progbits, 16
arch/x86/crypto/serpent-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx-x86_64-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask_0, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask_1, "aM", @progbits, 16
arch/x86/crypto/sha1_ni_asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha1_ni_asm.S:.section  .rodata.cst16.UPPER_WORD_MASK,
"aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16._SHUF_00BA, "aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16._SHUF_DC00, "aM", @progbits, 16
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_00BA, "aM", @progbits, 32
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_DC00, "aM", @progbits, 32
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16._SHUF_00BA, "aM", @progbits, 16
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16._SHUF_DC00, "aM", @progbits, 16
arch/x86/crypto/sha256_ni_asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha512-avx-asm.S:.section
.rodata.cst16.XMM_QWORD_BSWAP, "aM", @progbits, 16
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.MASK_YMM_LO, "aM", @progbits, 32
arch/x86/crypto/sha512-ssse3-asm.S:.section
.rodata.cst16.XMM_QWORD_BSWAP, "aM", @progbits, 16
arch/x86/crypto/twofish-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/twofish-avx-x86_64-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask, "aM", @progbits, 16
- EOT -

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ