From nobody Tue Nov 19 00:28:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XslhY6m9Nz5dG9H; Tue, 19 Nov 2024 00:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XslhY6LnQz4gD5; Tue, 19 Nov 2024 00:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hrQQq0F1gSb5MPYyNRDAsWytCUEiLjgezsUrP0g568I=; b=ZXZTLLkIzrYjxyRY3UBJqEkeQjgD4JRPMKcC7ghmyn+kFyYylLV7aGgFDi5+3J+2zZ6ONJ RJuyy2zaAMv2af17r6RIO7V5uWg/GEQjynZKVAww3RywFYbAyqxmM13TGisRcpa2vwMLUU OWNtrevWNecrLVDG6Ee8luFtJE6BZO4N4Q0dogJHUdk1eJBogt+uk+ifxnFIsHr8+/5PQE FJNBZT0pAhy5IIUfiHroA511KrluvIQTtcT5/NBqrNEsIduY+UAmrLrvI5Z8icCKM4MmSk COvUwPyabmUk3eacLKxerxjJKyd9oHeLGnum6Lwc+6O+3v9uxXoeHZ3GAWpOog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hrQQq0F1gSb5MPYyNRDAsWytCUEiLjgezsUrP0g568I=; b=ZY+tHWpKCCgTVPZLFi1IKL+NVEuLTRVkVO9yZyV2eiDmHItwAyR7YqVnFx/BXoIDgoOXs9 l+TMd6azKl1bnNpBl/JXLR8kYCUAUjy0J9oK7w6/xz0832+IJ9mxg7ORNh9AbMy2lsY8bL moGawKLha1FVGw6FF8gznpakQi1cHOIcrq1w3WdsDSFTyKwFD9m/GhKzWrr8+iKxaNghbr OHv0MNilH9kcvwCfjDrx55mzxa9MMCYcBpUqROJAcsudzScZwQtxiy5CbE0c4IOpp82Gac NBYQlzpzup1Djt8Chji4azeQvhvyJwPZZ6UlSo5+rywyiLA2D/jarQM4xFKLcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731976093; a=rsa-sha256; cv=none; b=ZqLEYwtzzY3GPgHQFhvCg3nOOmKHstiS4os4Ab1RAgq2RI4E9yyyD6Fq/EP+rCskFLVnxk H3Tv/O7B3fRCtXxoHAhsrQUa5tzzIrljsVBjpD5x6obWSUMctITkKQIUU5JbiHPv0pqYRw E3zNntGRxE3sz3Lh8Qe/m6qOw9jfM5BopG9u1LmUkcB6C1UzN5RDCbX7j/RIdf2DcU0yvi AxYQM+0nlIaWmbUsP8qUC4DfY166j1uA3zEAot8tqUPjJSIg5qhszwZ59LyWu+JevE/mm5 iJ4qhMSfFxnaFWtV5k+7/a6WJO5Tr0fgvGeu99J5DBfcCBia0KpWHmFXv3/0Hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XslhY5yGbz12Vh; Tue, 19 Nov 2024 00:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AJ0SD3q064603; Tue, 19 Nov 2024 00:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJ0SDlZ064600; Tue, 19 Nov 2024 00:28:13 GMT (envelope-from git) Date: Tue, 19 Nov 2024 00:28:13 GMT Message-Id: <202411190028.4AJ0SDlZ064600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 36f7ee7346cb - stable/13 - ipfilter: Avoid overrunning the message buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36f7ee7346cbdc9d19edb62da1526e1d970271b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=36f7ee7346cbdc9d19edb62da1526e1d970271b4 commit 36f7ee7346cbdc9d19edb62da1526e1d970271b4 Author: Cy Schubert AuthorDate: 2024-11-07 01:22:57 +0000 Commit: Cy Schubert CommitDate: 2024-11-19 00:27:07 +0000 ipfilter: Avoid overrunning the message buffer Avoid overrunning the message buffer when printing an ippool btree error. We do this in two ways. First we increase the message buffer from 80 to 255 bytes and secondly we replace strcat(3) with strlcat(3). (cherry picked from commit 42935716286e7887bfeb9dd8daea72d6a5d40908) --- sbin/ipf/libipf/load_poolnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ipf/libipf/load_poolnode.c b/sbin/ipf/libipf/load_poolnode.c index 5c9fd838bfa0..8d65f019da43 100644 --- a/sbin/ipf/libipf/load_poolnode.c +++ b/sbin/ipf/libipf/load_poolnode.c @@ -52,11 +52,11 @@ load_poolnode(int role, char *name, ip_pool_node_t *node, int ttl, if (err != 0) { if ((opts & OPT_DONOTHING) == 0) { - char msg[80]; + char msg[255]; snprintf(msg, sizeof(msg), "%s pool node(%s/", what, inet_ntoa(pn.ipn_addr.adf_addr.in4)); - strcat(msg, inet_ntoa(pn.ipn_mask.adf_addr.in4)); + strlcat(msg, inet_ntoa(pn.ipn_mask.adf_addr.in4), sizeof(msg)); return (ipf_perror_fd(pool_fd(), iocfunc, msg)); } }