From nobody Tue Sep 12 05:53:06 2023 X-Original-To: dev-commits-ports-main@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 4RlCRl0XZFz4sYRX; Tue, 12 Sep 2023 05:53:07 +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 4RlCRk6pQHz3dJy; Tue, 12 Sep 2023 05:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497987; 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=rSi9/LvCfq11uc5Zl4J+A7Gorxu2MSi3IpNz/j3ap3g=; b=fo6vrEn+AoFIsHdk6x7MS/TahAX3UdZP1CoA45lcuAbqVcxjQuAFCI5ERhx6Hy+1/sPXEa dkci3NnZVeX8/SOb9cYL3UCAGGC2Nv3X5VhO0S/RHr2rKPx8hOp0F0PhKpBx7zf6mM4ZS5 uOsmhRbykpOsyv9eiDvL3wdOBJJM5X0P5BOwwuzaY2SpwCrUzXVxs8k/4YgQJhKm0JWmIG Qvmkl8kBPeUK87S+LkKeDhphGefDPwxU4TLPUDK4cYDnq6NIxWf6tccjQXUp7T/Z0llfT2 uwvzSno8GAAPWudopwcXCLzUFF6psRwIcjFiTW5Ye3NJzlvgj3wiSOPM9A7Uzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694497987; a=rsa-sha256; cv=none; b=DxVO+yzkKaOOWrLhDWg3lXNYsvANMEs5uIusP3H0AKAOkzxz7GU573dUTU20QcEkI1CZB2 d0jJY4Je5v9bShTRdZ7i3OGOPiETx4UHU+nnf9VCJpt20OdORwnplXitQti6hsI+v54CRH EXeb8slUaqP8E16shMV/ZXS9+4gtk5TGIzgildTHi+A5g42rWYVLrWFQZFN/uiuzm6ByUA C5SlaXbZJ/A/y8EJCI+bszTjCj3WEYBJHHhxC8D2cdRgRflmiQT69JXZuRLHSO3P0MGyAB B+DphdBWrxMdLznwf+d2dLzQJqqDi8/JmJOcMMjIiqr5DM6wdnn6eKmEesTWhQ== 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=1694497987; 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=rSi9/LvCfq11uc5Zl4J+A7Gorxu2MSi3IpNz/j3ap3g=; b=SpXtfcnZBM87A2KDzF9OXe6iRdAAs00Dhu9ltp8BFwdl3LueYHVJJriSP959Lh/5Qmdu48 6NQv9zvOqohZnBYzdAzOaygr6DPxfbDgHOpXyTiISVEOxcSHIxQglY3oyc9Xd57wXC6Wps iO3NtdhGTVBBlnYwjcwdnp+kLd9HO+dGIo4cmfIlnZuIcIq+r9NOugOlAl5DaOjSHkWHzg vMJ6SUGXPpDtnz/0hWj2HxUECjioYILJB5jeNE1EMNr3x3za1tMGpmyQCPI5z1Oq9ambJv ZWXrBcAde8TQ9kDC7zNHzqhCDXj8I3e5gGve7nxlCdITIrKTrXDTmamK2Mxo7g== 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 4RlCRk54tkz5dN; Tue, 12 Sep 2023 05:53:06 +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 38C5r6Ba086671; Tue, 12 Sep 2023 05:53:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C5r6tB086668; Tue, 12 Sep 2023 05:53:06 GMT (envelope-from git) Date: Tue, 12 Sep 2023 05:53:06 GMT Message-Id: <202309120553.38C5r6tB086668@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: 5da13f40eeaa - main - security/wpa_supplicant-devel: Reapply c586ac04eb66 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 5da13f40eeaa4b39b3a9fd41e58d082e954acce6 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=5da13f40eeaa4b39b3a9fd41e58d082e954acce6 commit 5da13f40eeaa4b39b3a9fd41e58d082e954acce6 Author: Cy Schubert AuthorDate: 2023-09-12 05:08:11 +0000 Commit: Cy Schubert CommitDate: 2023-09-12 05:51:07 +0000 security/wpa_supplicant-devel: Reapply c586ac04eb66 Reapply "Fix 100% CPU when USB wlan NIC removed." hostapd calls pcap_next(3) to read the next packet off the wlan interface. pcap_next() returns a pointer to the packet header but does not indicate success or failure. Unfortunately this results in an infinite loop (100% CPU) when the wlan device disappears, i.e. when a USB wlan device is manually removed or a USB error results in the device removal. However pcap_next_ex(3) does return success or failure. To resolve this we use pcap_next_ex(), forcing hostapd to exit when the error is encountered. An error message is printed to syslog or stderr when debugging (-d flag) is enabled. Unfortunately wpa_printf() only works when debugging is enabled. PR: 253608, 273696 Obtained from: src 6e5d01124fd4 Reported by: Damjan Jovanovic , bz (privately) MFH: 2023Q3 --- security/wpa_supplicant-devel/Makefile | 2 +- .../files/patch-src_l2__packet_l2__packet__freebsd.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/security/wpa_supplicant-devel/Makefile b/security/wpa_supplicant-devel/Makefile index 7fc017f967bf..d28ed3db5b82 100644 --- a/security/wpa_supplicant-devel/Makefile +++ b/security/wpa_supplicant-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= wpa_supplicant PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 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 e256ee3860e1..62365bdc9900 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 2022-01-16 12:51:29.000000000 -0800 -+++ src/l2_packet/l2_packet_freebsd.c 2022-04-14 07:23:26.534960000 -0700 +--- 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 @@ -8,7 +8,10 @@ */ @@ -12,3 +12,15 @@ #include #endif /* __APPLE__ */ #include +@@ -82,7 +85,10 @@ + 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?"); ++ eloop_terminate(); ++ } + + if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) + return;