[LTP] [PATCH v1] read_all :catch alignment faults while reading sys entries seen in commit :bc21785b7336619fb6a67f1fff5afdaf229acc
Subramanya Swamy
subramanya.swamy.linux@gmail.com
Sun Jan 7 11:16:08 CET 2024
Hi,
On 03/01/24 20:43, Cyril Hrubis wrote:
> Hi!
>>> So the intention is to read the buffer in smaller chunks? I guess that
>>> it's hard to tell without having seen the kernel bugfix.
>> My bad i provided the wrong commit id in the commit message for the
>> kernel bugfix,
>> https://github.com/torvalds/linux/commit/1bbc21785b7336619fb6a67f1fff5afdaf229acc
> So it looks like the problem happens when we attempt to read the memory
> with unaligned offset, so I suppose that single:
>
> pread(fd, buf, 16, 1);
>
> Should trigger the problem, or do I miss something?
without the patch
https://github.com/torvalds/linux/commit/1bbc21785b7336619fb6a67f1fff5afdaf229acc
the issue is not reproducible with pread(fd,buf,16,1) , tried with odd
length of 15 to be read from file with offset 1 and it's reproducible
The reproducer for this issue is this dd command from patch
https://lore.kernel.org/linux-arm-kernel/20220304193107.5ljii5h4kmkwpl3f@redhat.com/
dd if=/sys/firmware/acpi/tables/data/BERT of=/dev/null bs=7
& this works to reproduce the issue
pread(fd, buf, 7, 1);
Best Regards
Subramanya
More information about the ltp
mailing list