[Pkg-sssd-devel] [Git][sssd-team/sssd][trixie] CVE-2026-80048

Bastien Roucariès (@rouca) gitlab at salsa.debian.org
Thu Nov 12 16:14:01 GMT 2026



Bastien Roucariès pushed to branch trixie at Debian SSSD packaging / sssd


Commits:
43cbdcd3 by Bastien Roucariès at 2026-11-12T16:29:13+01:00
CVE-2026-80048

- - - - -


6 changed files:

- debian/changelog
- + debian/patches/CVE-2026-80048_1.patch
- + debian/patches/CVE-2026-80048_2.patch
- + debian/patches/CVE-2026-80048_3.patch
- + debian/patches/CVE-2026-80048_4.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
 sssd (2.10.1-2+deb13u1) trixie; urgency=medium
 
+  [ Mike Gabriel ]
   * debian/patches:
     + Add CVE-2026-12610.diff. (Closes: #1141323).
       CVE-2026-12610: PAM: fix use-after-free during p11_child processing.
@@ -17,7 +18,16 @@ sssd (2.10.1-2+deb13u1) trixie; urgency=medium
       CVE-2026-68743: pam: validate auth_token_length in extract_authtok_v1().
       CVE-2026-68744: NSS: fix initgroups packet heap disclosure.
 
- -- Mike Gabriel <sunweaver at debian.org>  Tue, 08 Sep 2026 05:21:12 +0200
+  [ Bastien Roucariès ]
+  * debian/patches:
+    + Add CVE-2026-80048*.patch:
+      Fix flaw in sssd-kcm where a user with access to the
+      `sssd-kcm` UNIX socket has been able to cause the system to preallocate
+      significant memory by sending a large request length header, leading to
+      memory exhaustion, and thus ending in a DoS.
+      (Closes: #1150238)
+
+ --
 
 sssd (2.10.1-2) unstable; urgency=medium
 


=====================================
debian/patches/CVE-2026-80048_1.patch
=====================================
@@ -0,0 +1,110 @@
+From: =?utf-8?q?Pavel_B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Thu, 1 Oct 2026 15:05:43 +0200
+Subject: KCM: set the client fd non-blocking to avoid event-loop hangs
+
+The listening socket fd is non-blocking, but accept() does not propagate
+that flag to the accepted connection. KCM issues several I/O syscalls
+within a single tevent callback (read the length header then the body in
+kcm_recv_data(); write the length, retcode and payload in
+kcm_send_data()). A tevent event only guarantees the first syscall can
+make progress without blocking, so on a blocking fd a client that sends
+the 4-byte length header and withholds the body blocks readv() and hangs
+the entire single-threaded KCM responder event loop.
+
+Set the accepted fd non-blocking in kcm_connection_setup() so an
+incomplete transfer surfaces as EAGAIN and is retried on the next event.
+
+:fixes: CVE-2026-80048
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Sumit Bose <sbose at redhat.com>
+origin: upstream, https://github.com/SSSD/sssd/commit/d5f68d90381ac6f39e0fe972f59baf7996687203
+---
+ src/responder/kcm/kcmsrv_cmd.c | 60 ++++++++++++++++++++++++++----------------
+ 1 file changed, 38 insertions(+), 22 deletions(-)
+
+diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
+index ed2e069..1b0a4b2 100644
+--- a/src/responder/kcm/kcmsrv_cmd.c
++++ b/src/responder/kcm/kcmsrv_cmd.c
+@@ -59,34 +59,35 @@ static errno_t kcm_iovec_op(int fd, struct kcm_iovec *kiov, bool do_read)
+     ssize_t len;
+     struct iovec iov[1];
+ 
+-    iov[0].iov_base = kiov->kiov_base + kiov->nprocessed;
+-    iov[0].iov_len = kiov->kiov_len - kiov->nprocessed;
+-    if (iov[0].iov_len == 0) {
+-        /* This iovec is full (read) or depleted (write), proceed to the next one */
+-        return EOK;
+-    }
+-
+-    if (do_read) {
+-        len = readv(fd, iov, 1);
+-    } else {
+-        len = writev(fd, iov, 1);
+-    }
++    while (kiov->nprocessed < kiov->kiov_len) {
++        iov[0].iov_base = kiov->kiov_base + kiov->nprocessed;
++        iov[0].iov_len = kiov->kiov_len - kiov->nprocessed;
+ 
+-    if (len == -1) {
+-        if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
+-            return EAGAIN;
++        if (do_read) {
++            len = readv(fd, iov, 1);
+         } else {
+-            return errno;
++            len = writev(fd, iov, 1);
++        }
++
++        if (len == -1) {
++            if (errno == EINTR) {
++                /* Op was interupted but data may still be available. */
++                continue;
++            } else if (errno == EAGAIN || errno == EWOULDBLOCK) {
++                return EAGAIN;
++            } else {
++                return errno;
++            }
++        }
++
++        if (len == 0) {
++            /* Peer closed the connection (read side); nothing more to do. */
++            return ENODATA;
+         }
+-    }
+ 
+-    if (len == 0) {
+-        /* Read event on fd that doesn't yield data? error */
+-        return ENODATA;
++        kiov->nprocessed += len;
+     }
+ 
+-    /* Decrease the amount of available free space in the iovec */
+-    kiov->nprocessed += len;
+     return EOK;
+ }
+ 
+@@ -629,6 +630,21 @@ static void kcm_fd_handler(struct tevent_context *ev,
+ 
+ int kcm_connection_setup(struct cli_ctx *cctx)
+ {
++    errno_t ret;
++
++    /* KCM reads the length header and then the message body, and writes
++     * the reply length, retcode and payload, all within a single tevent
++     * callback. A tevent event only guarantees the first I/O will make
++     * progress without blocking; the later ones must be non-blocking, or
++     * a client that withholds the body (or does not drain the reply)
++     * would block the entire responder event loop. */
++    ret = sss_fd_nonblocking(cctx->cfd);
++    if (ret != EOK) {
++        DEBUG(SSSDBG_CRIT_FAILURE,
++              "Failed to set the KCM client fd non-blocking\n");
++        return ret;
++    }
++
+     cctx->cfd_handler = kcm_fd_handler;
+     return EOK;
+ }


=====================================
debian/patches/CVE-2026-80048_2.patch
=====================================
@@ -0,0 +1,86 @@
+From: =?utf-8?q?Pavel_B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Thu, 1 Oct 2026 15:10:25 +0200
+Subject: KCM: allocate body buffer only once
+
+Now that kcm_iovec_op() correctly returns EAGAIN on a partial body read,
+kcm_recv_data() is re-entered to resume the transfer. It re-allocated the
+body buffer on every entry, pointing v_msg.kiov_base at the new allocation
+while leaving nprocessed untouched: the previous partially-filled buffer
+was orphaned (a per-retry leak) and the already-read prefix of the new
+buffer was left uninitialized, corrupting the assembled message.
+
+Allocate the buffer only when kiov_base is still NULL, so re-entries keep
+filling the same allocation.
+
+Related to: CVE-2026-80048
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Sumit Bose <sbose at redhat.com>
+origin: upstream,  https://github.com/SSSD/sssd/commit/2c8f6382c6f1c49f38b883117c1614e25354d015
+---
+ src/responder/kcm/kcmsrv_cmd.c | 48 ++++++++++++++++++++++--------------------
+ 1 file changed, 25 insertions(+), 23 deletions(-)
+
+diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
+index 1b0a4b2..1e73807 100644
+--- a/src/responder/kcm/kcmsrv_cmd.c
++++ b/src/responder/kcm/kcmsrv_cmd.c
+@@ -423,32 +423,34 @@ static errno_t kcm_recv_data(TALLOC_CTX *mem_ctx,
+     uint32_t msglen;
+     errno_t ret;
+ 
+-    ret = kcm_read_iovec(fd, &reqbuf->v_len);
+-    if (ret != EOK) {
+-        /* Not all errors are fatal, hence we don't print DEBUG messages
+-         * here, but in the caller
+-         */
+-        return ret;
+-    }
++    if (reqbuf->v_msg.kiov_base == NULL) {
++        ret = kcm_read_iovec(fd, &reqbuf->v_len);
++        if (ret != EOK) {
++            /* Not all errors are fatal, hence we don't print DEBUG messages
++            * here, but in the caller
++            */
++            return ret;
++        }
+ 
+-    msglen = kcm_input_get_payload_len(&reqbuf->v_len);
+-    if (msglen > KCM_PACKET_MAX_SIZE) {
+-        DEBUG(SSSDBG_CRIT_FAILURE,
+-              "Request exceeds the KCM protocol limit, aborting\n");
+-        return E2BIG;
+-    }
++        msglen = kcm_input_get_payload_len(&reqbuf->v_len);
++        if (msglen > KCM_PACKET_MAX_SIZE) {
++            DEBUG(SSSDBG_CRIT_FAILURE,
++                  "Request exceeds the KCM protocol limit, aborting\n");
++            return E2BIG;
++        }
+ 
+-    msg = talloc_array(mem_ctx, uint8_t, msglen);
+-    if (msg == NULL) {
+-        DEBUG(SSSDBG_CRIT_FAILURE,
+-              "Failed to allocate memory for the message\n");
+-        return ENOMEM;
+-    }
+-    talloc_set_destructor((void *) msg, sss_erase_talloc_mem_securely);
++        msg = talloc_array(mem_ctx, uint8_t, msglen);
++        if (msg == NULL) {
++            DEBUG(SSSDBG_CRIT_FAILURE,
++                  "Failed to allocate memory for the message\n");
++            return ENOMEM;
++        }
++        talloc_set_destructor((void *) msg, sss_erase_talloc_mem_securely);
+ 
+-    /* Set the buffer and its expected len to receive the data */
+-    reqbuf->v_msg.kiov_base = msg;
+-    reqbuf->v_msg.kiov_len = msglen;
++        /* Set the buffer and its expected len to receive the data */
++        reqbuf->v_msg.kiov_base = msg;
++        reqbuf->v_msg.kiov_len = msglen;
++    }
+ 
+     ret = kcm_read_iovec(fd, &reqbuf->v_msg);
+     if (ret != EOK) {


=====================================
debian/patches/CVE-2026-80048_3.patch
=====================================
@@ -0,0 +1,50 @@
+From: =?utf-8?q?Pavel_B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Thu, 1 Oct 2026 15:11:08 +0200
+Subject: KCM: reject request bodies smaller than the protocol header
+
+kcm_recv_data() validated only the upper bound of the attacker-controlled
+body length, accepting any value down to zero. A body shorter than the
+4-byte protocol header (major, minor, opcode) can never be a valid KCM
+message, yet it was allocated, read, and only rejected deep in
+kcm_input_parse().
+
+Reject msglen < KCM_MSG_HEADER_SIZE up front, before any allocation.
+The SAFEALIGN_*_CHECK macros already prevent out-of-bounds reads, so this
+is defense-in-depth and earlier, cheaper rejection.
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Sumit Bose <sbose at redhat.com>
+(cherry picked from commit 4a7e9ac4a1c2c019511876f44579bfd0aebb21f8)
+origin:  https://github.com/SSSD/sssd/commit/4a7e9ac4a1c2c019511876f44579bfd0aebb21f8
+---
+ src/responder/kcm/kcmsrv_cmd.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
+index 1e73807..521b540 100644
+--- a/src/responder/kcm/kcmsrv_cmd.c
++++ b/src/responder/kcm/kcmsrv_cmd.c
+@@ -34,6 +34,10 @@
+ /* The return code is 32bits */
+ #define KCM_RETCODE_SIZE 4
+ 
++/* A valid request body carries at least the protocol header:
++ * major (uint8) + minor (uint8) + opcode (uint16). */
++#define KCM_MSG_HEADER_SIZE (2 * sizeof(uint8_t) + sizeof(uint16_t))
++
+ /* KCM operation, its raw input and raw output and result */
+ struct kcm_op_io {
+     struct kcm_op *op;
+@@ -433,6 +437,11 @@ static errno_t kcm_recv_data(TALLOC_CTX *mem_ctx,
+         }
+ 
+         msglen = kcm_input_get_payload_len(&reqbuf->v_len);
++        if (msglen < KCM_MSG_HEADER_SIZE) {
++            DEBUG(SSSDBG_CRIT_FAILURE, "Request body is too short, aborting\n");
++            return EBADMSG;
++        }
++
+         if (msglen > KCM_PACKET_MAX_SIZE) {
+             DEBUG(SSSDBG_CRIT_FAILURE,
+                   "Request exceeds the KCM protocol limit, aborting\n");


=====================================
debian/patches/CVE-2026-80048_4.patch
=====================================
@@ -0,0 +1,165 @@
+From: =?utf-8?q?Pavel_B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Fri, 23 Oct 2026 18:03:19 +0200
+Subject: KCM: add kcm_recv_timeout to avoid stuck requests
+
+This adds a new undocumented kcm "recv_timeout" option (defaults to 5s)
+and a timer on incoming request - the request payload must be read
+within the given time, otherwise the client connection is killed.
+
+Note that we can not just shorten the client_idle_timeout as that would
+prevent client reconnecting on interactive cli applications. See:
+00ae18dc9fd05a0dd12043d50a7fc0f1123bbc85
+
+Related to: CVE-2026-80048
+
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Sumit Bose <sbose at redhat.com>
+(cherry picked from commit 0721b661f1d44c0d57831f9881463fa047220db1)
+origin: https://github.com/SSSD/sssd/commit/0721b661f1d44c0d57831f9881463fa047220db1
+---
+ src/confdb/confdb.h            |  1 +
+ src/config/cfg_rules.ini       |  1 +
+ src/responder/kcm/kcm.c        | 13 +++++++++++++
+ src/responder/kcm/kcmsrv_cmd.c | 33 ++++++++++++++++++++++++++++++++-
+ src/responder/kcm/kcmsrv_pvt.h |  1 +
+ 5 files changed, 48 insertions(+), 1 deletion(-)
+
+diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
+index 633e0bc..91dcd63 100644
+--- a/src/confdb/confdb.h
++++ b/src/confdb/confdb.h
+@@ -306,6 +306,7 @@
+ #define CONFDB_KCM_KRB5_VALIDATE "krb5_validate"
+ #define CONFDB_KCM_KRB5_CANONICALIZE "krb5_canonicalize"
+ #define CONFDB_KCM_KRB5_AUTH_TIMEOUT "krb5_auth_timeout"
++#define CONFDB_KCM_RECV_TIMEOUT "recv_timeout" /* Undocumented on purpose */
+ 
+ /* Certificate mapping rules */
+ #define CONFDB_CERTMAP_BASEDN "cn=certmap,cn=config"
+diff --git a/src/config/cfg_rules.ini b/src/config/cfg_rules.ini
+index 9209022..4596b9b 100644
+--- a/src/config/cfg_rules.ini
++++ b/src/config/cfg_rules.ini
+@@ -271,6 +271,7 @@ option = description
+ option = socket_path
+ option = ccache_storage
+ option = responder_idle_timeout
++option = recv_timeout
+ option = max_ccaches
+ option = max_uid_ccaches
+ option = max_ccache_size
+diff --git a/src/responder/kcm/kcm.c b/src/responder/kcm/kcm.c
+index 1085437..6931a7b 100644
+--- a/src/responder/kcm/kcm.c
++++ b/src/responder/kcm/kcm.c
+@@ -34,6 +34,7 @@
+ 
+ #define DEFAULT_KCM_FD_LIMIT 2048
+ #define DEFAULT_KCM_CLI_IDLE_TIMEOUT 300
++#define DEFAULT_KCM_RECV_TIMEOUT 5
+ 
+ #ifndef SSS_KCM_SOCKET_NAME
+ #define SSS_KCM_SOCKET_NAME DEFAULT_KCM_SOCKET_PATH
+@@ -151,6 +152,18 @@ static int kcm_get_config(struct kcm_ctx *kctx)
+         kctx->rctx->client_idle_timeout = 10;
+     }
+ 
++    ret = confdb_get_int(kctx->rctx->cdb,
++                         kctx->rctx->confdb_service_path,
++                         CONFDB_KCM_RECV_TIMEOUT,
++                         DEFAULT_KCM_RECV_TIMEOUT,
++                         &kctx->recv_timeout);
++    if (ret != EOK) {
++        DEBUG(SSSDBG_OP_FAILURE,
++              "Cannot get the kcm recv timeout [%s] [%d]: %s\n",
++               CONFDB_KCM_RECV_TIMEOUT, ret, sss_strerror(ret));
++        goto done;
++    }
++
+     ret = confdb_get_string(kctx->rctx->cdb,
+                             kctx->rctx,
+                             kctx->rctx->confdb_service_path,
+diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
+index 521b540..569d0f6 100644
+--- a/src/responder/kcm/kcmsrv_cmd.c
++++ b/src/responder/kcm/kcmsrv_cmd.c
+@@ -344,6 +344,9 @@ struct kcm_req_ctx {
+     struct kcm_ctx *kctx;
+ 
+     struct kcm_op_io op_io;
++
++    /* cancel kcm_recv if data is not received in time */
++    struct tevent_timer *recv_timeout;
+ };
+ 
+ static void kcm_send_reply(struct kcm_req_ctx *req_ctx)
+@@ -472,6 +475,20 @@ static errno_t kcm_recv_data(TALLOC_CTX *mem_ctx,
+     return EOK;
+ }
+ 
++static void
++kcm_recv_timeout(struct tevent_context *ev,
++                 struct tevent_timer *te,
++                 struct timeval current_time,
++                 void *ptr)
++{
++    struct kcm_req_ctx *req = talloc_get_type(ptr, struct kcm_req_ctx);
++
++    DEBUG(SSSDBG_OP_FAILURE,
++          "Client %p did not send data in time, killing it\n", req->cctx);
++
++    talloc_free(req->cctx);
++}
++
+ /* Mind that kcm_new_req() does not take a mem_ctx argument on purpose as we
+  * really want the cctx to be the memory context here so that if the client
+  * disconnects, the request goes away. */
+@@ -479,6 +496,7 @@ static struct kcm_req_ctx *kcm_new_req(struct cli_ctx *cctx,
+                                        struct kcm_ctx *kctx)
+ {
+     struct kcm_req_ctx *req;
++    struct timeval tv;
+ 
+     req = talloc_zero(cctx, struct kcm_req_ctx);
+     if (req == NULL) {
+@@ -497,6 +515,18 @@ static struct kcm_req_ctx *kcm_new_req(struct cli_ctx *cctx,
+     req->cctx = cctx;
+     req->kctx = kctx;
+ 
++    if (kctx->recv_timeout > 0) {
++        tv = tevent_timeval_current_ofs(kctx->recv_timeout, 0);
++        req->recv_timeout = tevent_add_timer(cctx->ev, req, tv, kcm_recv_timeout,
++                                             req);
++        if (req->recv_timeout == NULL) {
++            DEBUG(SSSDBG_CRIT_FAILURE, "Cannot setup kcm_recv timeout\n");
++            talloc_free(req);
++            return NULL;
++        }
++    }
++
++
+     return req;
+ }
+ 
+@@ -541,7 +571,8 @@ static void kcm_recv(struct cli_ctx *cctx)
+         DEBUG(SSSDBG_TRACE_ALL, "Retry later\n");
+         return;
+     case EOK:
+-        /* all fine */
++        /* all data have been received */
++        talloc_zfree(req->recv_timeout);
+         break;
+     default:
+         DEBUG(SSSDBG_FATAL_FAILURE,
+diff --git a/src/responder/kcm/kcmsrv_pvt.h b/src/responder/kcm/kcmsrv_pvt.h
+index 0536a2c..2b4b645 100644
+--- a/src/responder/kcm/kcmsrv_pvt.h
++++ b/src/responder/kcm/kcmsrv_pvt.h
+@@ -71,6 +71,7 @@ enum kcm_ccdb_be {
+ struct kcm_ctx {
+     struct resp_ctx *rctx;
+     int fd_limit;
++    int recv_timeout;
+     char *socket_path;
+     enum kcm_ccdb_be cc_be;
+     struct kcm_ops_queue_ctx *qctx;


=====================================
debian/patches/series
=====================================
@@ -10,3 +10,7 @@ CVE-2026-68742.diff
 CVE-2026-68743.diff
 CVE-2026-68744.diff
 test_pam_srv-Use-more-random-UIDs-GIDs-for-the-test.diff
+CVE-2026-80048_1.patch
+CVE-2026-80048_2.patch
+CVE-2026-80048_3.patch
+CVE-2026-80048_4.patch



View it on GitLab: https://salsa.debian.org/sssd-team/sssd/-/commit/43cbdcd358c8f8c9cdfd4c237b713d3596bb4def

-- 
View it on GitLab: https://salsa.debian.org/sssd-team/sssd/-/commit/43cbdcd358c8f8c9cdfd4c237b713d3596bb4def
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-sssd-devel/attachments/20261112/6db2c051/attachment-0001.htm>


More information about the Pkg-sssd-devel mailing list