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

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