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

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