autofs/autofs-5.1.8-fix-additional-tsv-invalid-access.patch

45 lines
1.2 KiB
Diff

autofs-5.1.8 - fix additional tsv invalid access
From: Ian Kent <raven@themaw.net>
When using the --dumpmaps option of automount(8) a SEGV can occur
because a thread specific data variable accessed in the code hasn't
yet been created.
There is another thread specific data variable that is accessed when
dumping the maps so it needs to be created too.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
daemon/automount.c | 8 ++++++++
2 files changed, 9 insertions(+)
--- autofs-5.1.8.orig/CHANGELOG
+++ autofs-5.1.8/CHANGELOG
@@ -28,6 +28,7 @@
- fix memory leak in update_hosts_mounts().
- fix minus only option handling in concat_options().
- fix incorrect path for is_mounted() in try_remount().
+- fix additional tsv invalid access.
19/10/2021 autofs-5.1.8
- add xdr_exports().
--- autofs-5.1.8.orig/daemon/automount.c
+++ autofs-5.1.8/daemon/automount.c
@@ -2538,6 +2538,14 @@ int main(int argc, char *argv[])
exit(1);
}
+ status = pthread_key_create(&key_thread_attempt_id, free);
+ if (status) {
+ logerr("%s: failed to create thread data key for attempt ID!",
+ program);
+ macro_free_global_table();
+ exit(1);
+ }
+
if (master)
master_list = master_new(NULL, timeout, flags);
else