Re: [PATCH v6 0/4] Introduce mseal()

From: Randy Dunlap
Date: Sat Jan 13 2024 - 00:57:38 EST




On 1/12/24 20:53, Jeff Xu wrote:
> On Fri, Jan 12, 2024 at 6:20 PM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>>
>>
>>
>> On 1/11/24 15:41, jeffxu@xxxxxxxxxxxx wrote:
>>> From: Jeff Xu <jeffxu@xxxxxxxxxx>
>>>
>>> This patchset proposes a new mseal() syscall for the Linux kernel.
>>>
>>
>> Jeff,
>> Building arm64 defconfig, on linux-next-20240112, I get:
>>
> I don't quite get how this is related to my change.
> Can you please send me the steps to reproduce ? I don't usually build arm.

I don't get how it's related either, but when I build arm64 defconfig without
your patches, it builds without errors. After applying your patches, it has
errors... I did it 2 times just to make sure.

It may just be some difference between x86_64 headers (is that what you
build?) and arm64 headers.

Install the x86_64-hosted arm64 compiler from
https://mirrors.edge.kernel.org/pub/tools/crosstool/ in
e.g. /opt/crosstool .


In the kernel source tree:
mkdir ARM64

make ARCH=arm64 O=ARM64 defconfig
make -j25 CROSS_COMPILE=/opt/crosstool/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux- ARCH=arm64 O=ARM64 all 2>&1 | tee aa64defcon.lst

make ARCH=arm64 O=ARM64 clean
<apply your mseal patches>
make -j25 CROSS_COMPILE=/opt/crosstool/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux- ARCH=arm64 O=ARM64 all 2>&1 | tee aa64mseal.lst


If that does not reproduce the problem, please let me know.

(I use a script, but that's the essence of the script.)



>> CC arch/arm64/kernel/asm-offsets.s
>> In file included from ../include/uapi/linux/mman.h:5,
>> from ../include/linux/mm.h:33,
>> from ../include/linux/memblock.h:12,
>> from ../arch/arm64/include/asm/acpi.h:14,
>> from ../include/acpi/acpi_io.h:7,
>> from ../include/linux/acpi.h:39,
>> from ../include/acpi/apei.h:9,
>> from ../include/acpi/ghes.h:5,
>> from ../include/linux/arm_sdei.h:8,
>> from ../arch/arm64/kernel/asm-offsets.c:10:
>> ../arch/arm64/include/asm/mman.h: In function 'arch_calc_vm_prot_bits':
>> ../arch/arm64/include/asm/mman.h:15:24: error: 'VM_ARM64_BTI' undeclared (first use in this function); did you mean 'ARM64_BTI'?
>> 15 | ret |= VM_ARM64_BTI;
>> | ^~~~~~~~~~~~
>> | ARM64_BTI
>> ../arch/arm64/include/asm/mman.h:15:24: note: each undeclared identifier is reported only once for each function it appears in
>> ../arch/arm64/include/asm/mman.h:18:24: error: 'VM_MTE' undeclared (first use in this function); did you mean 'VM_MAP'?
>> 18 | ret |= VM_MTE;
>> | ^~~~~~
>> | VM_MAP
>> ../arch/arm64/include/asm/mman.h: In function 'arch_calc_vm_flag_bits':
>> ../arch/arm64/include/asm/mman.h:32:24: error: 'VM_MTE_ALLOWED' undeclared (first use in this function)
>> 32 | return VM_MTE_ALLOWED;
>> | ^~~~~~~~~~~~~~
>> ../arch/arm64/include/asm/mman.h: In function 'arch_validate_flags':
>> ../arch/arm64/include/asm/mman.h:59:29: error: 'VM_MTE' undeclared (first use in this function); did you mean 'VM_MAP'?
>> 59 | return !(vm_flags & VM_MTE) || (vm_flags & VM_MTE_ALLOWED);
>> | ^~~~~~
>> | VM_MAP
>> ../arch/arm64/include/asm/mman.h:59:52: error: 'VM_MTE_ALLOWED' undeclared (first use in this function)
>> 59 | return !(vm_flags & VM_MTE) || (vm_flags & VM_MTE_ALLOWED);
>> | ^~~~~~~~~~~~~~
>>
>>
>> --
>> #Randy
>

--
#Randy