From nobody Tue Sep 12 05:53:10 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 4RlCRp3Bhhz4sYGS; Tue, 12 Sep 2023 05:53:10 +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 4RlCRp1tW2z3dHf; Tue, 12 Sep 2023 05:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497990; 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=lQSmNJgcvraRH8v0C+NxELQq3YeK4zWJLMBhJP+oErA=; b=IUneoWEJW+h4Qh6WTpIUiMxC547vji/POgeRF1VAvJjd6EBIRxizP+XDvr1Pi5OA9V3Q/8 FWLQdTEGwQipLXOJNGudqbrQ+kG+wbVS10comrF0C057GlCOBuyc1o1iPPrBtkMR7GDsI4 cp2I7Bv3iZhasx4H1sT6BwKxmmrWAJ/ip0FsrJ5PJ22Q2g5hAS2zc1YHhynOQYGlFSOagi 9NFrai3htCaXf1N4owLH09vhLkzz0G4qyxnn5lw2QMQhJrPEg78tKvPcUa4Ck184i1T+8j iZ+Ripr06uY1tSud2zF9MXz1T6I5fcHfUfXesjFs0J+XRXMXtC8P/TWagdQZ0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694497990; a=rsa-sha256; cv=none; b=LvYuPsLdS1DpcYXuGf+6LhJtyRekV3hZm0B6qO6lRaLcgd26WksGoTefmrtWPsgroF8mvM 8D/EFS2Rl8Dm+CahroXeDB0hOgMni66XYlgaCr5O3nB0R3nM2hDsbUmfU2y/qAhwTmcb7v 8ZpI2XBlxQ0xQr2NnHwb21G5H/u1qNj6zbjZLJu31sBhW8oNFkOmGOqDgsJJzV7MZIqylB iaSrZbFtNk+V913yejrWvLu+xfeocy8sSaM8aOyM/v9xJhXtaxUhVfG7+Fv/QTV9Fg3wot JvOuhNdoDN9ZKpORnjsKc1WQFYBTghSjnHzk72WcUMOudfxXp26Q7+y7NqU95Q== 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=1694497990; 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=lQSmNJgcvraRH8v0C+NxELQq3YeK4zWJLMBhJP+oErA=; b=I1p6vyrLfRGpEHJpto1VE3Gwm8rJ4JDlvKVrTJW94HD+TbHVT3Nnlv/wGzQ7StAnfvJ7Up 2LZYRDNFQXFzD/2Gf78TzdJMYI9Or3nSYBsW2dTuejNED/a/kPyk9YNTf7ocZXvDaK5ktl yNoUCDbsCK02cCAtlPj7DU/TX8BvL2FUnNoIOdpQdcoz6gEgF7GjwzOArTrTuqKSzXwHxj xhxs6sQM26mTQqTBa4epRsZWhx3ybUZS9YCjBxmKOHDON+Zb8w6Dz90FfFEBzdzWaJ3ORb S9hVFe1BQT+NjtY1UWk7vQ3c+46lqV5pZFA+UeE5T9DGJdkjsc0NFGWAneYdew== 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 4RlCRp0xkHz5SJ; Tue, 12 Sep 2023 05:53:10 +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 38C5rAwN086818; Tue, 12 Sep 2023 05:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C5rARS086815; Tue, 12 Sep 2023 05:53:10 GMT (envelope-from git) Date: Tue, 12 Sep 2023 05:53:10 GMT Message-Id: <202309120553.38C5rARS086815@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: e7f23d81ae4b - main - 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/main X-Git-Reftype: branch X-Git-Commit: e7f23d81ae4b522701ab73482a3bb3e3a76f6e67 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=e7f23d81ae4b522701ab73482a3bb3e3a76f6e67 commit e7f23d81ae4b522701ab73482a3bb3e3a76f6e67 Author: Cy Schubert AuthorDate: 2023-09-12 05:17:18 +0000 Commit: Cy Schubert CommitDate: 2023-09-12 05:51:16 +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 MFH: 2023Q3 --- 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(); + }