]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: util.c: fix buffer overflow in alias_normalize() master
authorAnton Moryakov <ant.v.moryakov@gmail.com>
Tue, 10 Mar 2026 16:07:15 +0000 (19:07 +0300)
committerLucas De Marchi <demarchi@kernel.org>
Thu, 23 Apr 2026 05:23:07 +0000 (00:23 -0500)
commitd236920b20fd70a139f8af2ff6f5c18d830be491
tree33e14a9afe056c133d37ae0342616bba7532135f
parent2ef7ade1d11d1203dc0f8767f2cdc578c39ed759
shared: util.c: fix buffer overflow in alias_normalize()

The while-loop inside the '[' case of alias_normalize() increments the
index 'i' without checking against PATH_MAX bounds. If the input string
contains an opening '[' followed by many characters without a closing ']',
the index can exceed PATH_MAX-1, causing a buffer overflow when writing
to buf[i].

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/431
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
shared/util.c