[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ext4: Give 32bit personalities 32bit hashes
From: |
Florian Weimer |
Subject: |
Re: [PATCH] ext4: Give 32bit personalities 32bit hashes |
Date: |
Tue, 17 Mar 2020 12:52:04 +0100 |
* Linus Walleij:
> It was brought to my attention that this bug from 2018 was
> still unresolved: 32 bit emulators like QEMU were given
> 64 bit hashes when running 32 bit emulation on 64 bit systems.
>
> The personality(2) system call supports to let processes
> indicate that they are 32 bit Linux to the kernel. This
> was suggested by Teo in the original thread, so I just wired
> it up and it solves the problem.
>
> Programs that need the 32 bit hash only need to issue the
> personality(PER_LINUX32) call and things start working.
>
> I made a test program like this:
>
> #include <dirent.h>
> #include <errno.h>
> #include <stdio.h>
> #include <string.h>
> #include <sys/types.h>
> #include <sys/personality.h>
>
> int main(int argc, char** argv) {
> DIR* dir;
> personality(PER_LINUX32);
> dir = opendir("/boot");
> printf("dir=%p\n", dir);
> printf("readdir(dir)=%p\n", readdir(dir));
> printf("errno=%d: %s\n", errno, strerror(errno));
> return 0;
> }
>
> This was compiled with an ARM32 toolchain from Bootlin using
> glibc 2.28 and thus suffering from the bug.
Just be sure: Is it possible to move the PER_LINUX32 setting into QEMU?
(I see why not.)
However, this does not solve the issue with network file systems and
other scenarios. I still think need to add a workaround to the glibc
implementation.
- [PATCH] ext4: Give 32bit personalities 32bit hashes, Linus Walleij, 2020/03/17
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes,
Florian Weimer <=
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Peter Maydell, 2020/03/17
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Linus Walleij, 2020/03/19
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Peter Maydell, 2020/03/19
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Linus Walleij, 2020/03/19
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Theodore Y. Ts'o, 2020/03/23
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Peter Maydell, 2020/03/24
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Theodore Y. Ts'o, 2020/03/24
- Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Linus Walleij, 2020/03/24
Re: [PATCH] ext4: Give 32bit personalities 32bit hashes, Andreas Dilger, 2020/03/17