untrusted comment: verify with openbsd-78-base.pub RWS3/nvFmk4SWaF+9cjegphgZuFgArVe5OF015VFzz3pKCCnx2F5/g326Q5eGK0wUxyZ0tUrmshJ8S+3t5OfyRcPzMDwQQL2bAM= OpenBSD 7.8 errata 057, September 14, 2026: In ldapd(8), an authentication result from one transaction could be applied to another. Apply by doing: signify -Vep /etc/signify/openbsd-78-base.pub -x 057_ldapd.patch.sig \ -m - | (cd /usr/src && patch -p0) And then rebuild and install ldapd cd /usr/src/usr.sbin/ldapd make obj make make install Index: usr.sbin/ldapd/auth.c =================================================================== RCS file: /cvs/src/usr.sbin/ldapd/auth.c,v diff -u -p -u -r1.16 auth.c --- usr.sbin/ldapd/auth.c 11 May 2025 15:38:48 -0000 1.16 +++ usr.sbin/ldapd/auth.c 10 Sep 2026 02:44:25 -0000 @@ -187,7 +187,7 @@ send_auth_request(struct request *req, c if (strlcpy(auth_req.password, password, sizeof(auth_req.password)) >= sizeof(auth_req.password)) goto fail; - auth_req.fd = req->conn->fd; + auth_req.id = req->conn->id; auth_req.msgid = req->msgid; if (imsgev_compose(iev_ldapd, IMSG_LDAPD_AUTH, 0, 0, -1, &auth_req, Index: usr.sbin/ldapd/conn.c =================================================================== RCS file: /cvs/src/usr.sbin/ldapd/conn.c,v diff -u -p -u -r1.21 conn.c --- usr.sbin/ldapd/conn.c 26 Jun 2023 10:28:12 -0000 1.21 +++ usr.sbin/ldapd/conn.c 10 Sep 2026 02:44:25 -0000 @@ -30,6 +30,7 @@ int conn_dispatch(struct conn *conn); int conn_tls_init(struct conn *); unsigned int ldap_application(struct ber_element *elm); +uint64_t conn_id; struct conn_list conn_list; unsigned int @@ -298,6 +299,7 @@ conn_accept(int fd, short event, void *d goto giveup; } ober_set_application(&conn->ber, ldap_application); + conn->id = conn_id++; conn->fd = afd; conn->listener = l; @@ -334,12 +336,12 @@ giveup: } struct conn * -conn_by_fd(int fd) +conn_by_id(uint64_t id) { struct conn *conn; TAILQ_FOREACH(conn, &conn_list, next) { - if (conn->fd == fd) + if (conn->id == id) return conn; } return NULL; Index: usr.sbin/ldapd/ldapd.c =================================================================== RCS file: /cvs/src/usr.sbin/ldapd/ldapd.c,v diff -u -p -u -r1.32 ldapd.c --- usr.sbin/ldapd/ldapd.c 10 Feb 2022 13:06:46 -0000 1.32 +++ usr.sbin/ldapd/ldapd.c 10 Sep 2026 02:44:25 -0000 @@ -355,7 +355,7 @@ ldapd_auth_request(struct imsgev *iev, s log_debug("authenticating [%s]", areq->name); ares.ok = ldapd_auth_classful(areq->name, areq->password); - ares.fd = areq->fd; + ares.id = areq->id; ares.msgid = areq->msgid; memset(areq, 0, sizeof(*areq)); imsgev_compose(iev, IMSG_LDAPD_AUTH_RESULT, 0, 0, -1, &ares, Index: usr.sbin/ldapd/ldapd.h =================================================================== RCS file: /cvs/src/usr.sbin/ldapd/ldapd.h,v diff -u -p -u -r1.37 ldapd.h --- usr.sbin/ldapd/ldapd.h 21 May 2024 05:00:48 -0000 1.37 +++ usr.sbin/ldapd/ldapd.h 10 Sep 2026 02:44:25 -0000 @@ -215,6 +215,7 @@ TAILQ_HEAD(listenerlist, listener); struct conn { TAILQ_ENTRY(conn) next; int fd; + uint64_t id; struct bufferevent *bev; struct ber ber; int disconnect; @@ -269,7 +270,7 @@ struct ldapd_stats struct auth_req { - int fd; + uint64_t id; long long msgid; char name[128]; char password[128]; @@ -278,7 +279,7 @@ struct auth_req struct auth_res { int ok; - int fd; + uint64_t id; long long msgid; }; @@ -337,8 +338,9 @@ extern struct ldapd_stats stats; extern struct ldapd_config *conf; /* conn.c */ +extern uint64_t conn_id; extern struct conn_list conn_list; -struct conn *conn_by_fd(int fd); +struct conn *conn_by_id(uint64_t id); void conn_read(struct bufferevent *bev, void *data); void conn_write(struct bufferevent *bev, void *data); void conn_err(struct bufferevent *bev, short w, void *data); Index: usr.sbin/ldapd/ldape.c =================================================================== RCS file: /cvs/src/usr.sbin/ldapd/ldape.c,v diff -u -p -u -r1.40 ldape.c --- usr.sbin/ldapd/ldape.c 11 May 2025 15:38:48 -0000 1.40 +++ usr.sbin/ldapd/ldape.c 10 Sep 2026 02:44:25 -0000 @@ -352,6 +352,7 @@ ldape(int debug, int verbose, char *csoc char host[128]; mode_t old_umask = 0; + conn_id = 0; TAILQ_INIT(&conn_list); ldap_loginit("ldap server", debug, verbose); @@ -533,10 +534,12 @@ ldape_auth_result(struct imsg *imsg) struct conn *conn; struct auth_res *ares = imsg->data; - log_debug("authentication on conn %d/%lld = %d", ares->fd, ares->msgid, + log_debug("authentication on conn %llu/%lld = %d", ares->id, ares->msgid, ares->ok); - conn = conn_by_fd(ares->fd); - if (conn->bind_req != NULL && conn->bind_req->msgid == ares->msgid) + conn = conn_by_id(ares->id); + if (conn == NULL) + log_warnx("auth result with no connection"); + else if (conn->bind_req != NULL && conn->bind_req->msgid == ares->msgid) ldap_bind_continue(conn, ares->ok); else log_warnx("spurious auth result");