milos-linux/fs/qnx6
Arpith Kalaginanavoor 89c4a1167f
fs/qnx6: fix pointer arithmetic in directory iteration
The conversion to qnx6_get_folio() in commit b2aa61556f
("qnx6: Convert qnx6_get_page() to qnx6_get_folio()")
introduced a regression in directory iteration. The pointer 'de'
and the 'limit' address were calculated using byte offsets from
a char pointer without scaling by the size of a QNX6 directory
entry.

This causes the driver to read from incorrect memory offsets,
leading to "invalid direntry size" errors and premature
termination of directory scans.

Fix this by casting 'kaddr' to 'struct qnx6_dir_entry *' before
applying the offset and last_entry(...) increments. This allows the
compiler to correctly scale the pointer arithmetic by the 32-byte
stride of the directory entry structure.

Fixes: b2aa61556f ("qnx6: Convert qnx6_get_page() to qnx6_get_folio()")
Cc: stable@vger.kernel.org
Signed-off-by: Arpith Kalaginanavoor <arpithk@nvidia.com>
Link: https://patch.msgid.link/20260526123858.1683035-1-arpithk@nvidia.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-05-28 14:16:33 +02:00
..
dir.c fs/qnx6: fix pointer arithmetic in directory iteration 2026-05-28 14:16:33 +02:00
inode.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile
namei.c qnx6: Convert qnx6_find_entry() to qnx6_find_ino() 2024-08-07 11:31:55 +02:00
qnx6.h qnx6: Convert directory handling to use kmap_local 2024-08-07 11:31:56 +02:00
super_mmi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00