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

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