From nobody Thu Apr 14 13:48:24 2022 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 BF8451B4B26A; Thu, 14 Apr 2022 13:48:24 +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 4KfLQJ543wz4hWM; Thu, 14 Apr 2022 13:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649944104; 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=NtHJ3f4cUaiw4tJcyEcaIoCC6HR5d7k6z3sx3Vi8Y5A=; b=R6zU9mVX3ilg5cHGFA9DZllfJMj9ShXoj7Lz0FqjLj5qTvmpcVuWypbsO7/yKvnJj83vwv ETLNz+0GcjavREDS2oOk+3/pPzqf6jSYL+chZoCQq3DjevQz2S39qGPllqJGDcW7ZohZJO MMQkgMQsM2aXCexSuPEYdHrC2z8aXkJKB4SpPiAXTSIcH+EV3VIpyno4ASzNfoyKMWyZJn afqTKmqbCzkETgg2Q+7gcnI2tqpP5+f5rW0RqEXSawjHkf1lD96xcRKw2e5cXc0gqe5ZWM y61IY637JdWjP/iqNzIOwvX5h0/glN8c6qUciwxTR+jRGoEqpaG+jnwsVuoYdg== 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 8BD3A216D2; Thu, 14 Apr 2022 13:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23EDmOgx067009; Thu, 14 Apr 2022 13:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23EDmO7p067008; Thu, 14 Apr 2022 13:48:24 GMT (envelope-from git) Date: Thu, 14 Apr 2022 13:48:24 GMT Message-Id: <202204141348.23EDmO7p067008@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: d7365cc80c65 - stable/13 - wpa: Correctly call pcap_next_ex() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d7365cc80c6532973e529195bddf9dbf7f35c239 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649944104; 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=NtHJ3f4cUaiw4tJcyEcaIoCC6HR5d7k6z3sx3Vi8Y5A=; b=m5e1XQstT9kH31pP1w2+Lbhctkl0/xMGGQXy3j2u96MZr5gfXlmcMIjBndCc0tHhAhCvan UjiWvlJYTCpgUbjwl1nQuBPiztoppQkBraXyVll+l5t7tM5BDVYvV5KqdkdPtD6ZRTd4ED kjHiI1qhJUhrcHFVF6lGu74hi38M8HmmnZiFMzKGB/P5dcPSIISRyiS2eaxeFJ5a883FR5 tlwCaLm5BpLkR/th67jRG8CLX6KZl8oT1IajZFowN8H5x/MrI2R4+Wum8pzwSOxA30hvX0 FUgjSia0pUwTjvH5fMBRWjXG77Q2GHpbRHe1waEiAXBwYt9DYRI3WqYdhftaJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649944104; a=rsa-sha256; cv=none; b=GrtnvMTA0zhgh+hwGeCR+u/u5JjAkAGpHYf9mu2/y/BPX2vqnSv8kzPO/pdtXi3VsonwTo 5Mq9V5By79qX9eE2+5NpoxFmcxyC4HYoFn5/6oSH43/YBrFsmNnB5i5wnhOoNCdHZJEi9d nHtBZLDQumliaG6viRFyi+7iiYvaTjdA3tCNXZe4tcRS8PSdA+6wF1JaNAwOVQMTNzxO3o rpSMtT6ZzZ/tzufjWd6mB+HilHXJTKItdyHjl3Q8vYza8W2HLQdQwx915GwSdhp1iis7c1 u9TxKAKFTt6mtLNAPoz+IJ57Eo7x03bzkz5xZHdmyCW/jqDs8qIlqQDr6Q8dOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d7365cc80c6532973e529195bddf9dbf7f35c239 commit d7365cc80c6532973e529195bddf9dbf7f35c239 Author: Cy Schubert AuthorDate: 2022-04-14 01:45:49 +0000 Commit: Cy Schubert CommitDate: 2022-04-14 13:48:11 +0000 wpa: Correctly call pcap_next_ex() The second argument to pcap_next_ex() is a pointer to a pointer. Not a pointer. This fixes a wpa_supplicent SIGSEGV. PR: 263266 Reported by: Marek Zarychta Fixes: 6e5d01124fd4dd57899ddd9260c76dbb43543aa7 (cherry picked from commit 1e0ca65a3bb5798a80eccaae58d863f1f08b9ae8) --- contrib/wpa/src/l2_packet/l2_packet_freebsd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/wpa/src/l2_packet/l2_packet_freebsd.c b/contrib/wpa/src/l2_packet/l2_packet_freebsd.c index da742f432120..0461758ff210 100644 --- a/contrib/wpa/src/l2_packet/l2_packet_freebsd.c +++ b/contrib/wpa/src/l2_packet/l2_packet_freebsd.c @@ -77,7 +77,7 @@ static void l2_packet_receive(int sock, void *eloop_ctx, void *sock_ctx) { 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; @@ -88,16 +88,16 @@ static void l2_packet_receive(int sock, void *eloop_ctx, void *sock_ctx) eloop_terminate(); } - 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); }