]> git.ipfire.org Git - thirdparty/u-boot.git/commit
net: lwip: nfs: fix buffer overflow when using symlinks
authorPranav Tilak <pranav.vinaytilak@amd.com>
Mon, 23 Mar 2026 09:44:14 +0000 (15:14 +0530)
committerJerome Forissier <jerome.forissier@arm.com>
Tue, 31 Mar 2026 14:43:28 +0000 (16:43 +0200)
commitfd6e3d34097f9fbe268aa56a50fecc013f4d07a3
tree6612cf003a59ae26dee5fe2dc4ea56a7fb04980b
parent078e2663e44ae36a66d4f4cd9b6506689e328633
net: lwip: nfs: fix buffer overflow when using symlinks

When resolving a symlink, nfs_path points into a heap allocated buffer
which is just large enough to hold the original path with no extra
space. If the symlink target name is longer than the original
filename, the write goes beyond the end of the buffer corrupting
heap memory.

Fix this by ensuring nfs_path always points to a buffer large enough
to accommodate the resolved symlink path.

Fixes: 230cf3bc2776 ("net: lwip: nfs: Port the NFS code to work with lwIP")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Acked-by: Jerome Forissier <jerome.forissier@arm.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
net/lwip/nfs.c