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: <20230710170629.GB30916@twin.jikos.cz>
Date:   Mon, 10 Jul 2023 19:06:29 +0200
From:   David Sterba <dsterba@...e.cz>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>, Arnd Bergmann <arnd@...db.de>,
        Johannes Thumshirn <johannes.thumshirn@....com>,
        Qu Wenruo <wqu@...e.com>, Anand Jain <anand.jain@...cle.com>,
        Nikolay Borisov <nborisov@...e.com>,
        Changbin Du <changbin.du@...el.com>,
        linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] btrfs: fix 64-bit division link failure

On Wed, Jul 05, 2023 at 04:01:09PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> Some of the recent refactoring of the statfs code apparently
> brought back a link failure on older gcc versions that I had
> fixed before:
> 
> arm-linux-gnueabi-ld: fs/btrfs/super.o: in function `btrfs_statfs':
> super.c:(.text+0xec40): undefined reference to `__aeabi_uldivmod'
> 
> I think what happened is that gcc is free to not inline a function
> despite the 'inline' annotation, and when this happens it can end
> up partially inlining the div_u64() helper in a way that breaks the
> __builtin_constant_p() based optimization.
> 
> I only see this behavior for gcc-9, but it's possible that the same
> thing happens in later versions as well when the code changes again.

This is second fix to work around compiler assumptions and dependency
from other code, somehow this feels like the fix is being done in the
wrong place. Filesystem code using a number division helpers that are
supposed to abstract away 64bit division problems are as far as we
should go. Speculating about partial inlining or working/not-working
constant value detection maybe belongs to some highly optimized code but
not to a plain API usage.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ