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]
Date:   Sun, 16 Apr 2023 07:47:42 +0200
From:   Christoph Hellwig <hch@....de>
To:     William McVicker <willmcvicker@...gle.com>
Cc:     Theodore Ts'o <tytso@....edu>, hch@....de,
        linux-ext4@...r.kernel.org,
        "Stephen E. Baker" <baker.stephen.e@...il.com>,
        adilger.kernel@...ger.ca
Subject: Re: simplify ext4_sb_read_encoding regression

On Fri, Apr 14, 2023 at 04:01:47PM -0700, William McVicker wrote:
> I believe I figured out what is going on here since I am hitting a similar
> issue with CONFIG_UNICODE. If you take a look at the .config from Stephen's
> message, you'll see that he sets:
> 
>   CONFIG_TRIM_UNUSED_KSYMS=y
>   CONFIG_UNUSED_KSYMS_WHITELIST=""
> 
> When trimming is enabled, kbuild will strip all exported symbols that are not
> listed in the whitelist. As a result, when utf8-core.c calls:
> 
>   um->tables = symbol_request(utf8_data_table);
> 
> it will fail since `utf8_data_table` doesn't exist in the exported section of
> the kernel symbol table. For me on Android, this leads to the userdata
> partition failing to mount. To be clear, this happens when CONFIG_UNICODE=y.
> 
> One question I have is -- Why are we using symbol_request()/symbol_put() when
> `utf8_data_table` is exported? Why can't we directly reference the
> `utf8_data_table` symbol?

We could, but that would require to always include the huge utf8
case folding tables into the kernel.

The idea here is that there is no sane way to move the utf8 handling code
into a module that only gets used some times, because common file systems
like ext4 call into it.  But they only actually use the case folding for
the very rare case of someone actually using the case insensitive file
system feature, so we only load the module containing the table for that
case.

> If we need to use symbol_request() when CONFIG_UNICODE=m, then can we apply the
> below patch to fix this when CONFIG_UNICODE=y? I have verified this works for
> me with CONFIG_UNICODE=y and CONFIG_TRIM_UNUSED_KSYMS=y.

We could do that, but it seems a bit ugly.  What prevents symbol_request
from working properly for this case in your setup?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ