summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2020-06-22 15:09:34 +0000
committermestre <mestre@openbsd.org>2020-06-22 15:09:34 +0000
commitb0e92afdb4c1febd6a9c51d593bd84477c9b51f6 (patch)
tree9ae9916a466ffd0db027ffe1d2498bee84f9b860
parentSome connectors attach late when the drm driver is registers. For (diff)
downloadwireguard-openbsd-b0e92afdb4c1febd6a9c51d593bd84477c9b51f6.tar.xz
wireguard-openbsd-b0e92afdb4c1febd6a9c51d593bd84477c9b51f6.zip
On my previous commit I made the wrong assumption that the control socket was
being unlink(2)ed from the main proc so I removed "cpath" from the pledge(2) on the ldpe proc but actually the socket was unlink(2)ed from here, this means the daemon would crash on exit due to pledge(2) not having "cpath" permissions anymore. Finish the job by just not deleting the socket at all during control_cleanup(), which keeps the control program still working without issues but more importantly prevents the crash during exit, sorry about that. Crash reported by wlund at iki.fi OK deraadt@ claudio@ remi@
-rw-r--r--usr.sbin/ldpd/control.c5
-rw-r--r--usr.sbin/ldpd/control.h4
-rw-r--r--usr.sbin/ldpd/ldpe.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c
index fe0eebdbea6..5c598cd1917 100644
--- a/usr.sbin/ldpd/control.c
+++ b/usr.sbin/ldpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.29 2017/03/03 23:30:57 renato Exp $ */
+/* $OpenBSD: control.c,v 1.30 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -98,11 +98,10 @@ control_listen(void)
}
void
-control_cleanup(char *path)
+control_cleanup(void)
{
accept_del(control_fd);
close(control_fd);
- unlink(path);
}
/* ARGSUSED */
diff --git a/usr.sbin/ldpd/control.h b/usr.sbin/ldpd/control.h
index f4f5525707d..72a9aa837a6 100644
--- a/usr.sbin/ldpd/control.h
+++ b/usr.sbin/ldpd/control.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.h,v 1.9 2017/03/03 23:30:57 renato Exp $ */
+/* $OpenBSD: control.h,v 1.10 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -32,7 +32,7 @@ extern struct ctl_conns ctl_conns;
int control_init(char *);
int control_listen(void);
-void control_cleanup(char *);
+void control_cleanup(void);
int control_imsg_relay(struct imsg *);
#endif /* _CONTROL_H_ */
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c
index 6200d552882..404743ee8d5 100644
--- a/usr.sbin/ldpd/ldpe.c
+++ b/usr.sbin/ldpd/ldpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.c,v 1.76 2019/08/10 01:30:53 mestre Exp $ */
+/* $OpenBSD: ldpe.c,v 1.77 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -171,7 +171,7 @@ ldpe_shutdown(void)
msgbuf_clear(&iev_main->ibuf.w);
close(iev_main->ibuf.fd);
- control_cleanup(global.csock);
+ control_cleanup();
config_clear(leconf);
if (sysdep.no_pfkey == 0) {