From nobody Thu Apr 14 13:48:47 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 B04DC1B4B4DC; Thu, 14 Apr 2022 13:48:47 +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 4KfLQl4R5Sz4hfh; Thu, 14 Apr 2022 13:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649944127; 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=KxjjAk5cCisbwkEhhKjIYVfuEjAdhI5aBEEqIf5xGyM=; b=XiSJsyZl4up43qNxvHlaZgYPdEbHd+1xhiKnp/uncdAoG5C69JyE9Ofq6uLnpYlsEKD1zX Fcgn5PXatsOGglD2toLE79Ivh4WDUmwoJP6GC6cFjfSgN9zuEhKmkVLAhthezzvU7fgwxU N8LfW+PC4s0lB7WM9WtDdIQONHUALEMAKPgGvnjE7M9N504fCFCTliXbJrcwzytqOneSVS Ns49b8Rml6MCBnH+01Hg7dY3qSNXgqFRv7rt9eBozqgg1KUYVCUmmUYuO2EKwuSWM0kY63 4EJSSrrmZHbcn8TVDeC0I7CYvj7aif2W/SjzJIbMzZvKbxaxrd998tiCCI1h+Q== 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 77A6521A1D; Thu, 14 Apr 2022 13:48:47 +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 23EDmlWN067155; Thu, 14 Apr 2022 13:48:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23EDml8j067154; Thu, 14 Apr 2022 13:48:47 GMT (envelope-from git) Date: Thu, 14 Apr 2022 13:48:47 GMT Message-Id: <202204141348.23EDml8j067154@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: 6def5bc64cb9 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 6def5bc64cb9b97b4978b5fa6fa8d9ba36deddd8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649944127; 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=KxjjAk5cCisbwkEhhKjIYVfuEjAdhI5aBEEqIf5xGyM=; b=q+PNDO7aXWINm65Y/OFGVAWGcVUeP+0LnkJvaMrqQqPmNXPzU7dslRueT7nOWw6lXaawnm XW3GMw3bALWCKMrbb0Q5jC197LjQEh35GXZN3z378o7i9iYlKnFLHds4TVtUcHcpOxdU0E Gzcf7yLX+SlKhHZ8OC2TzjJjQUx4AtIZqV9v0Oi9b1t+6LpdFjn7yTdQd7lCKfbQd+ysOQ VkZ8WgvCxEnWoOW3D+udcOnwAgp1JuHDQJ1ApuDT/fgH9p880CNwSYG45GpT47hB4HQGeX YeJyQhyvKeThj05XTsYIjQYWj3fsW/I2Qjc8RJ2y/jxH1qMuskJ1TSRv/Wb54A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649944127; a=rsa-sha256; cv=none; b=hEQgXY3/j3W7eT+1FfwSZUtzcbP7/BYViBODCpnWx7kMmvu6Wy7ExZWOf9AlIZ1s7V7wP/ f584LGLO4TkRPcGs3PS5UhcdRxGq48AMAFh6rgQiyMb6wozQOejyiF3D7jqX5TniUrSTXm XuP9yEtQYTZnGiE8RH2eMd62co6rWPTG0rgHU3ebxH0UbPOBnXmcQG/2zixn6qF/Nr0Jgj bjN/U4GtaXryvqH97R3bA1cIKvTg2d6LzFpM1T4NdI7WoIk3PmbdE1QxF1N29hhTLFsvU0 nYXSCf9oZLz1yq+9fbZ9KZ4Gbeer+tTKCiW7DxvlK+DbwHK42PA7tQHHJmJ/4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6def5bc64cb9b97b4978b5fa6fa8d9ba36deddd8 commit 6def5bc64cb9b97b4978b5fa6fa8d9ba36deddd8 Author: Cy Schubert AuthorDate: 2022-04-14 01:45:49 +0000 Commit: Cy Schubert CommitDate: 2022-04-14 13:48:39 +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); }