From nobody Fri Sep 15 14:08:44 2023 X-Original-To: dev-commits-ports-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 4RnGJF00Mqz4sTs4; Fri, 15 Sep 2023 14:08:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RnGJD6X9Xz4Fpx; Fri, 15 Sep 2023 14:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694786924; 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=x7R7BHudwQYf4MMqY+cocoQk0PDsIVrgvXJ8I/LrjF0=; b=iBU84FNpFSE/U4EfDas0RlgM+41sN74AotHHPZ8VZiTFds9FWedHK8YvzwaWlrAfMfM8WY EsQJ3Kmjy663yRbwqbhmuqwj7LSksITwnX7hgEInmthkRu6WR919em8hMwJwuKYhOVC7I2 mFWD0tdhqJPKQ4tr2ZWrpJ5G2OQRbmy6EYy8lNt/goHgiM3WUyAYup7bMP/KVbMMwSKIP3 tAm836q11mk2GhfGA+hbJdtyLnZA0uMq0iD5bIaikBPtWr3uYrg0JLIX4x8TgLo96WeUMa hcmhU65LOONJgIUwAQXIiC2vqI0fxgQvUurpe8H+tJGULtiqV9Mfr4yy7uBw9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694786924; a=rsa-sha256; cv=none; b=gEFaqzB2EbtypMfhbL+SEO8kde22xn8YEYaEOVMh9H/bPEMRRa+gsGQF/M//+YYK+PwdSP cI2OFaIunppGpVLN5/bbaqU2eXlsNEGjurym/Nof3S9EO0xNVG1OsVwYoBs/qdx1nBfJiw g2tD7HromVNseW9QawFUiDfdn4edOXenCahYoRTzQjLw1w+E/3znRvF02FGOb5Mh5hBk+s Hq3LBL7pVW2TOz7kRsp4xlG94Ix/BhhdPZKnboCvCmRhc97CfZUpUl1tFMbEjsNVmMFmiv 6rz6n+HdUrS8uPItPPpPAzIqXaAM/nozKdD3tSf9wvMLw9Vwqcspdlz8MhknLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694786924; 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=x7R7BHudwQYf4MMqY+cocoQk0PDsIVrgvXJ8I/LrjF0=; b=DmqxU+I29cBaMoiHB2RpbwtcgLRq4uD7EzKtUtWAQUGzwR/Q8BZCHaDBAk8uDpDw4pSFwk nD6/wYW7EF0+jEb2mPSOFAlQLZeJZfv9YlrGMcpB4L7xnveZwj/pgFq6uiHIFL6Sp5Sk1Z hhrehOwHGdUGxPfZkQ69p504oafQTew/PukhYKQwSYLPWF415E55ini9+giXCveitQLKg2 7zGjWa6Jp5xn1qz9801biqa5M5Q4fNrp6V7gR/To+RWXIqawkOPSL5vRAbA+yqO+4jC1/5 470lpYQwco1CdDH6jM8buaQmqD6g8iuaWr7QYfAQn2r4kyds0q23A2G3foA1zQ== 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 4RnGJD5dRjzBql; Fri, 15 Sep 2023 14:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38FE8iDd090666; Fri, 15 Sep 2023 14:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38FE8i87090663; Fri, 15 Sep 2023 14:08:44 GMT (envelope-from git) Date: Fri, 15 Sep 2023 14:08:44 GMT Message-Id: <202309151408.38FE8i87090663@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Cy Schubert Subject: git: 0b110f1e3e17 - 2023Q3 - security/wpa_supplicant-devel: Fix uninitialized packet pointer on error List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-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: ports X-Git-Refname: refs/heads/2023Q3 X-Git-Reftype: branch X-Git-Commit: 0b110f1e3e172f3ec29a1ff548ef30adfaa82277 Auto-Submitted: auto-generated The branch 2023Q3 has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=0b110f1e3e172f3ec29a1ff548ef30adfaa82277 commit 0b110f1e3e172f3ec29a1ff548ef30adfaa82277 Author: Cy Schubert AuthorDate: 2023-09-12 05:17:05 +0000 Commit: Cy Schubert CommitDate: 2023-09-15 14:07:43 +0000 security/wpa_supplicant-devel: Fix uninitialized packet pointer on error The packet pointer (called packet) will remain uninitialized when pcap_next_ex() returns an error. This occurs when the wlan interface is shut down using ifconfig destroy. Adding a NULL assignment to packet duplicates what pcap_next() does. The reason we use pcap_next_ex() in this instance is because with pacp_next() when we receive a null pointer if there was an error or if no packets were read. With pcap_next_ex() we can differentiate between an error and legitimately no packets were received. PR: 270649, 273696 Obtained from: src 953efa5b200f Reported by: Robert Morris (cherry picked from commit a872b8a14f51721830232b127cc6ac27663a903d) --- security/wpa_supplicant-devel/Makefile | 2 +- .../patch-src_l2__packet_l2__packet__freebsd.c | 28 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/security/wpa_supplicant-devel/Makefile b/security/wpa_supplicant-devel/Makefile index d28ed3db5b82..ccc6c1b32cdd 100644 --- a/security/wpa_supplicant-devel/Makefile +++ b/security/wpa_supplicant-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= wpa_supplicant PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= security net PKGNAMESUFFIX= -devel diff --git a/security/wpa_supplicant-devel/files/patch-src_l2__packet_l2__packet__freebsd.c b/security/wpa_supplicant-devel/files/patch-src_l2__packet_l2__packet__freebsd.c index 62365bdc9900..224ca67ee95f 100644 --- a/security/wpa_supplicant-devel/files/patch-src_l2__packet_l2__packet__freebsd.c +++ b/security/wpa_supplicant-devel/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -1,5 +1,5 @@ --- src/l2_packet/l2_packet_freebsd.c.orig 2023-09-05 10:38:47.000000000 -0700 -+++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:06:24.154851000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:12:22.076149000 -0700 @@ -8,7 +8,10 @@ */ @@ -12,15 +12,37 @@ #include #endif /* __APPLE__ */ #include -@@ -82,7 +85,10 @@ +@@ -76,24 +79,28 @@ + { + struct l2_packet_data *l2 = eloop_ctx; + pcap_t *pcap = sock_ctx; +- struct pcap_pkthdr hdr; ++ struct pcap_pkthdr *hdr; + const u_char *packet; + struct l2_ethhdr *ethhdr; unsigned char *buf; size_t len; - packet = pcap_next(pcap, &hdr); + if (pcap_next_ex(pcap, &hdr, &packet) == -1) { + wpa_printf(MSG_ERROR, "Error reading packet, has device disappeared?"); ++ packet = NULL; + eloop_terminate(); + } - if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) +- if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) ++ if (!l2->rx_callback || !packet || hdr->caplen < sizeof(*ethhdr)) return; + + ethhdr = (struct l2_ethhdr *) packet; + if (l2->l2_hdr) { + buf = (unsigned char *) ethhdr; +- len = hdr.caplen; ++ len = hdr->caplen; + } else { + buf = (unsigned char *) (ethhdr + 1); +- len = hdr.caplen - sizeof(*ethhdr); ++ len = hdr->caplen - sizeof(*ethhdr); + } + l2->rx_callback(l2->rx_callback_ctx, ethhdr->h_source, buf, len); + }