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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5d3d2fc-874c-a8e3-1320-f9396a3621b5@redhat.com>
Date:   Mon, 8 Apr 2019 15:56:08 +0200
From:   Denys Vlasenko <dvlasenk@...hat.com>
To:     sedat.dilek@...il.com
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate
 filename $module/.rodata.cst{16,32}

On 4/8/19 3:36 PM, Sedat Dilek wrote:
> 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.).

Not sure how exactly this causes the error, but the cause seems to be
having more than one section with the same name. This occurs in only three files
(grep for ".rodata.cst16," string):

cast6-avx-x86_64-asm_64.S
camellia-aesni-avx2-asm_64.S
camellia-aesni-avx-asm_64.S

/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
.section        .rodata.cst16, "aM", @progbits, 16

In other places I used .rodata.cst16.OBJECTNAME, but in these three cases
there are more than one object in the section, so I left it w/o OBJECTNAME.

I propose to change section name, append _module_ name and optionally
a comment why this is done:

  /* NB: section is mergeable, all elements must be aligned 16-byte blocks */
+/* There is more than one object in this section, let's use module name
+   as unique suffix */
-.section        .rodata.cst16, "aM", @progbits, 16
+.section        .rodata.cst16.cast6-avx-x86_64-asm_64, "aM", @progbits, 16


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

linker does not create section names. Compiler does for .c files,
for .S files they are made by a human.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ