Blame SOURCES/autofs-5.1.7-add-length-check-in-umount_subtree_mounts.patch

49b67f
autofs-5.1.7 - add length check in umount_subtree_mounts()
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
Coverity: fixed_size_dest: You might overrun the 4097-character
49b67f
	  fixed-size string "key" by copying "me->key" without
49b67f
	  checking the length.
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG          |    1 +
49b67f
 daemon/automount.c |    5 +++++
49b67f
 2 files changed, 6 insertions(+)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -55,6 +55,7 @@
49b67f
 - fix possible memory leak in master_parse().
49b67f
 - fix possible memory leak in mnts_add_amdmount().
49b67f
 - fix double unlock in parse_mount().
49b67f
+- add length check in umount_subtree_mounts().
49b67f
 
49b67f
 xx/xx/2018 autofs-5.1.5
49b67f
 - fix flag file permission.
49b67f
--- autofs-5.1.4.orig/daemon/automount.c
49b67f
+++ autofs-5.1.4/daemon/automount.c
49b67f
@@ -562,6 +562,11 @@ static int umount_subtree_mounts(struct
49b67f
 			left++;
49b67f
 		}
49b67f
 
49b67f
+		if (me->len > PATH_MAX) {
49b67f
+			crit(ap->logopt, "me->key too long for buffer");
49b67f
+			return 1;
49b67f
+		}
49b67f
+
49b67f
 		strcpy(key, me->key);
49b67f
 
49b67f
 		cache_unlock(mc);