Blame SOURCES/rsyslog-8.1911.0-rhbz1843994-imfile-selinux-symlink-crash.patch

94be23
From 89ff6436b55cd81c54dcb076490b0c4de98d508d Mon Sep 17 00:00:00 2001
94be23
From: Jiri Vymazal <jvymazal@redhat.com>
94be23
Date: Tue, 9 Jun 2020 12:09:59 +0200
94be23
Subject: [PATCH] Fixing imfile segfaulting on selinux denial
94be23
94be23
If imfile is denied access to file watched trough symlink there is
94be23
unchecked condition resulting in access to not initialized memory.
94be23
---
94be23
 plugins/imfile/imfile.c | 2 +-
94be23
 1 file changed, 1 insertion(+), 1 deletion(-)
94be23
94be23
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
94be23
index f360bd290b..21d6546552 100644
94be23
--- a/plugins/imfile/imfile.c
94be23
+++ b/plugins/imfile/imfile.c
94be23
@@ -732,7 +732,7 @@ act_obj_add(fs_edge_t *const edge, const char *const name, const int is_file,
94be23
 		} else { /* reporting only in debug for dirs as higher lvl paths are likely blocked by selinux */
94be23
 			DBGPRINTF("imfile: error accessing directory '%s'", name);
94be23
 		}
94be23
-		FINALIZE;
94be23
+		ABORT_FINALIZE(RS_RET_NO_FILE_ACCESS);
94be23
 	}
94be23
 	DBGPRINTF("add new active object '%s' in '%s'\n", name, edge->path);
94be23
 	CHKmalloc(act = calloc(sizeof(act_obj_t), 1));