Re: [PATCH] selinux: use explicit 64-bit division
From: Arnd Bergmann
Date: Tue Sep 15 2026 - 16:43:27 EST
On Tue, Sep 15, 2026, at 22:36, Paul Moore wrote:
> On Tue, Sep 15, 2026 at 3:57 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>>
>> From: Arnd Bergmann <arnd@xxxxxxxx>
>>
>> On 32-bit targets, the division of a 64-bit integer by 33 causes a
>> function call:
>>
>> arm-linux-gnueabi-ld: security/selinux/selinuxfs.o: in function `sel_read_class':
>> selinuxfs.c:(.text+0xdcc): undefined reference to `__aeabi_uldivmod'
>> arm-linux-gnueabi-ld: security/selinux/selinuxfs.o: in function `sel_read_perm':
>> selinuxfs.c:(.text+0xed0): undefined reference to `__aeabi_uldivmod'
>>
>> Replace this with an explicit call to div_u64() and div_u64_rem() to
>> annotate that these are potentially very slow.
>>
>> Fixes: fc68b6a45f16 ("selinux: convert selinuxfs inode numbers from unsigned long to u64")
>> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
>> ---
>> security/selinux/selinuxfs.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Thanks Arnd.
>
> As sashiko pointed out[1], since we don't really use the full 64-bit
> inode space, what do you think about the following fix instead?
Ah right, I hadn't checked the actual value of SEL_INO_MASK, and the
description of your patch made it sound like the 64-bit space
was actually required.
Your patch is better then, you can treat my mail as Reported-by.
Arnd