kmod/0001-libkmod-fix-an-overflow-with-wrong-modules.builtin.m.patch
Eugene Syromiatnikov 62e12e062c Fix issues discovered by static analysis
Applu 4 patches that fix various minor issues:
 - v29~5 "libkmod: fix an overflow with wrong modules.builtin.modinfo"
 - v31~29 "libkmod: do not crash on unknown signature algorithm"
 - v31~18 "libkmod: error out on unknown hash algorithm"
 - v33~1 "libkmod: avoid undefined behaviour in libkmod-builtin.c:get_string"

* 0001-libkmod-avoid-undefined-behaviour-in-libkmod-builtin.patch: New
file.
* 0001-libkmod-do-not-crash-on-unknown-signature-algorithm.patch:
Likewise.
* 0001-libkmod-error-out-on-unknown-hash-algorithm.patch: Likewise.
* 0001-libkmod-fix-an-overflow-with-wrong-modules.builtin.m.patch:
Likewise.
* kmod.spec (Release): Bump to 10.
(Patch02, Patch03, Patch04, Patch05): New patches.
(%changelog): New record.

Resolves: RHEL-34073
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2024-08-16 15:19:03 +02:00

30 lines
845 B
Diff

From 1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90 Mon Sep 17 00:00:00 2001
From: Seung-Woo Kim <sw0312.kim@samsung.com>
Date: Tue, 13 Apr 2021 20:23:14 +0900
Subject: [PATCH] libkmod: fix an overflow with wrong modules.builtin.modinfo
Fix a possbile overflow with exact PATH_MAX length modname
in wrong modules.builtin.modinfo.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
libkmod/libkmod-builtin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c
index fc9a376..a75a542 100644
--- a/libkmod/libkmod-builtin.c
+++ b/libkmod/libkmod-builtin.c
@@ -246,7 +246,7 @@ bool kmod_builtin_iter_get_modname(struct kmod_builtin_iter *iter,
len = dot - line;
- if (len > PATH_MAX) {
+ if (len >= PATH_MAX) {
sv_errno = ENAMETOOLONG;
goto fail;
}
--
2.13.6