From nobody Fri Sep 15 14:08:45 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 4RnGJG1tBKz4sTxN; Fri, 15 Sep 2023 14:08:46 +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 4RnGJG0RrMz4G67; Fri, 15 Sep 2023 14:08:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694786926; 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=3Nt5mHcJ9rFOFzGGavL0to/XSLPb8x1s0OdeSpdSzfY=; b=jZy1J91tvwIoK7XxK6ObkTMOyLx0hl8312TEmYsyVsACo5m0XHE2HFFbopUYCLel5ca6g2 JKmCV1cgCK8orps7ZDUtH0lkdw+pVgTwruCamQXZ4ynChLWCOY3S9zJJglXIMIIncJOIzN WB7pc2IKz4+fVkkT+DzImXAcNcMkqevQNbgPG35kNHe5fvK9AWyYRddI4ZDAk6Gdlii1CO EZb9R9IBArmFS3zIbazPnKtLANnQm7Z6oBCQqNs6ipszyNkA+8MKv8sRgCSt4uyG7xz0w2 OcQc8YEw4E1wrKD6hPzzyiaJpvZ9pc5vdVW8+FOclT2dRQt0+AJOZdErOTeDoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694786926; a=rsa-sha256; cv=none; b=UkjnEBH+WB46P65YDc3oWJ55gjYtIs3PsMlQ+br5GKeRWB6NGA9MRFCLDNaCljPr/iEbE+ pnWZRmBQBOEHLkuhoaGclwR2SSRZrISfILUdXfBApmQBV/727dcSTEZFnaP/TJSRvuE0mG UIRQfLGqsXQ5C6R/Rnuu10wSYnZYnA6l3UlglIKgi/Tg6+95YZm73MtQUs9qy1lc6+WCgA BMHVI00OFS+QSxxv1pmSH9vuiBq6jQwGoUuCHjuUi8W57ChN1ztqRWcNZa+F9sMwyLh26v DNNptjOjh48zUgwkM/J9svLDffsS/VEQc5kemkqE4MQfTmdxOl4Vi6tEQkBRqw== 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=1694786926; 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=3Nt5mHcJ9rFOFzGGavL0to/XSLPb8x1s0OdeSpdSzfY=; b=bbksv3QR5KbaJpG4LdF6/T+47KdpiGI04HjvKI4Zh8ss5gBCAVcAPEts0Nt0IiV+BMHvjp T2KPrgw9J3iuWWQ+/fNYvqJLx1Q7TFygDR4/PRD1Q6ziTzmUC20ZtCLFEMaJyhpWqZiVYx kkqF8qfuVKFzsHWwS4h2YoT2pZZ0pYre5LNHxi1OCDVfg2lLOD3ODfoBFQS57+UQAtlugD TAiuiWqOqvmxXJNjSGM+7l/T50+zCLCOva6uV3i6gX1Sog0Up2W5SaspAcJ3Q06nURXe/o SwlSCdjPTYzlJIHHFa3Ccw3z8/iqsOJ5ridzXI6g+D4r2rcYMkbg0Vj0xRBWrg== 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 4RnGJF6fp8zBS7; Fri, 15 Sep 2023 14:08:45 +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 38FE8js1090716; Fri, 15 Sep 2023 14:08:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38FE8jHM090713; Fri, 15 Sep 2023 14:08:45 GMT (envelope-from git) Date: Fri, 15 Sep 2023 14:08:45 GMT Message-Id: <202309151408.38FE8jHM090713@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: 6f4c310eecc8 - 2023Q3 - net/hostapd: 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: 6f4c310eecc8e585f5df84ddd2b88cf76f51e543 Auto-Submitted: auto-generated The branch 2023Q3 has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=6f4c310eecc8e585f5df84ddd2b88cf76f51e543 commit 6f4c310eecc8e585f5df84ddd2b88cf76f51e543 Author: Cy Schubert AuthorDate: 2023-09-12 05:17:18 +0000 Commit: Cy Schubert CommitDate: 2023-09-15 14:07:44 +0000 net/hostapd: 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 e7f23d81ae4b522701ab73482a3bb3e3a76f6e67) --- net/hostapd/Makefile | 2 +- net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/hostapd/Makefile b/net/hostapd/Makefile index b6db58496f49..1e6d5841681a 100644 --- a/net/hostapd/Makefile +++ b/net/hostapd/Makefile @@ -1,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= 2.10 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net MASTER_SITES= https://w1.fi/releases/ diff --git a/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c index c8be8a1c9c12..9d290e5dff5c 100644 --- a/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c +++ b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -1,5 +1,5 @@ --- src/l2_packet/l2_packet_freebsd.c.orig 2022-01-16 12:51:29.000000000 -0800 -+++ src/l2_packet/l2_packet_freebsd.c 2022-04-14 07:35:30.668820000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:00:09.826831000 -0700 @@ -8,7 +8,10 @@ */ @@ -12,7 +12,7 @@ #include #endif /* __APPLE__ */ #include -@@ -76,24 +79,27 @@ +@@ -76,24 +79,28 @@ { struct l2_packet_data *l2 = eloop_ctx; pcap_t *pcap = sock_ctx; @@ -26,6 +26,7 @@ - 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(); + }