Message ID | 20211012224004.9704-1-masashi.honma@gmail.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LenhOYBF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XX6JulAW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HTVzF4dlVz9t0T for <incoming@patchwork.ozlabs.org>; Wed, 13 Oct 2021 09:42:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fUHblzXlDCOaEeKP5WznyO01cpyufUFVb5+A2jVSIiM=; b=LenhOYBFF3RR2k imlP+xQGDT/fr6EGO+IbiQZ6VoUz2BRU9Ythohj/SjQvq+kcciFf44ZKMykMXWf1A7Ooe8ojiPbH/ QXTmQvISd0zxhM8Abm7ro7fjeEsLAGLT4n5xlNPQYY2h8wqAzZ4nhq40NHdDGzmH3OCkhbhjbDZFE 2a561NNAuGxtFfTq+lCPsKH1WFwI1GFlRZE65WsZosnmRAk0G3s46cxxa5zhkVmO4emBmvvMImyf9 p+TsMSbpyQTGs9LPb7UzxVnGiFUZfSFD3QyIo1oUwQByyVaeYhe3731ithyRD3/9WvctXASZx1Hpx oIDwl17BbHmKIoLuZq1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1maQRy-00E6YH-E6; Tue, 12 Oct 2021 22:40:46 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1maQRv-00E6Xr-IU for hostap@lists.infradead.org; Tue, 12 Oct 2021 22:40:44 +0000 Received: by mail-pg1-x533.google.com with SMTP id 66so442882pgc.9 for <hostap@lists.infradead.org>; Tue, 12 Oct 2021 15:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9FjWgwqZZKNS8wE/1gSt3TRFLmFcGBFz34jTcakwVqY=; b=XX6JulAW0KcWPsGE4O6NbrE1JRmsY2Ci2Cwem4ClUlqJy2e3sEXDTEfu8TSoALaTLf 9iH1cBraQ7Rd6uezSaH9EIMp18V27YloXkCrChp0bGPNSf8X2r7eOLCaB/J7uHVetMgo ZGCo3khb4AJ0d6GOtyVR8ilT12GNneN93Gd/bMJ+h6AnkWMeW90diNPuz0nOySwwLwZD 9wNx/T3ORzSH09UOAnMGK3/iC1bgI6uvcMZhoCPKxn0GNUzK1HutXMzVOG55w1x7dFcn 1qNv+9aTOjRHdeT8KX6MfeW1ZBuSd2YFKUgOJFJjZG0BCs/JRWTkLm/kgc1T/xOp0Alb 2qLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9FjWgwqZZKNS8wE/1gSt3TRFLmFcGBFz34jTcakwVqY=; b=chxf87XV6E/nn+TDIVqnx2IyKP/y8Bi+y876Wcw2TaoPs7umVqFsp+wET3GJy1n/+C f+XflcQSmJrhIG6Su0lW2wVRiy3BM93mpVlNTxkUjKxyvyWjz67U5sjHyzKB5ItAIBv/ PHBtIjqw/KQuwHuE4JUifR3pMwBmwR1m7A3Mdc+t8Ma2WIziKvUAxEah09APp47trp6o uCWPnae6FYDsbKpjRLPBv4VouKhUEFQ4D/gxdP2LA9Xw5VVnU8TEgDemuXhSn1ntXdyM R/ryj91kTxvV+gYfadI53RKnfyiBcJTHXq6l2A+1v3Wnt8XMGY0ybsxTypTlB1JotoWK ecoQ== X-Gm-Message-State: AOAM533vj2ert49mxg+hSaE9j7BkrBdsF4Ac3A80OcKGVqKyP6Ovg08y OVDCggCbk1zndPKzovizLLGzzZ+HQMw= X-Google-Smtp-Source: ABdhPJwLl7tQquMx/+6WtfUl5XK4quXEAbrTqeX5g8NHUl0jN8yWMU2ms5nxb5o3N1M6CxtZZ0AYfw== X-Received: by 2002:a63:e446:: with SMTP id i6mr25281577pgk.288.1634078442178; Tue, 12 Oct 2021 15:40:42 -0700 (PDT) Received: from gtx1060.flets-east.jp ([2409:11:53c0:1f00:c83:6905:44d1:a011]) by smtp.gmail.com with ESMTPSA id l14sm6927209pgt.17.2021.10.12.15.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 15:40:41 -0700 (PDT) From: Masashi Honma <masashi.honma@gmail.com> To: hostap@lists.infradead.org Cc: Masashi Honma <masashi.honma@gmail.com>, Corentin Labbe <clabbe.montjoie@gmail.com> Subject: [PATCH] Fix segfault of hostapd_cli wps_config to non WPS AP Date: Wed, 13 Oct 2021 07:40:04 +0900 Message-Id: <20211012224004.9704-1-masashi.honma@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211012_154043_652631_38C56FF0 X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Execution of "hostapd_cli wps_config" to non WPS AP causes segmentation fault. $ hostapd_cli wps_config test WPA2PSK CCMP 12341234 wlp11s0: interface state UNINITIALIZED->COUNTRY_UPDATE wlp11s0: interface state COUNTRY_UPDATE->ENABLED wlp11s0: AP-ENABLED WPA_TRACE: eloop SIGSEGV - START [1]: ./git/hostap/hostapd/hostapd(+0x6c196) [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:533 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [masashi.honma[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <hostap.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/hostap>, <mailto:hostap-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/hostap/> List-Post: <mailto:hostap@lists.infradead.org> List-Help: <mailto:hostap-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/hostap>, <mailto:hostap-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Hostap" <hostap-bounces@lists.infradead.org> Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
Fix segfault of hostapd_cli wps_config to non WPS AP
|
expand
|
On Wed, Oct 13, 2021 at 07:40:04AM +0900, Masashi Honma wrote: > Execution of "hostapd_cli wps_config" to non WPS AP causes segmentation fault. > [3]: ./git/hostap/hostapd/hostapd(hostapd_wps_config_ap+0x1a9) [0x55b2702ce349] > hostapd_wps_config_ap() ../src/ap/wps_hostapd.c:1970 Thanks, applied.
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 9f22e39a2..4f1c76b7b 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -1964,6 +1964,11 @@ int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid, cred.key_len = len / 2; } + if (!hapd->wps) { + wpa_printf(MSG_ERROR, "WPS: WPS config does not exist"); + return -1; + } + return wps_registrar_config_ap(hapd->wps->registrar, &cred); }
Execution of "hostapd_cli wps_config" to non WPS AP causes segmentation fault. $ hostapd_cli wps_config test WPA2PSK CCMP 12341234 wlp11s0: interface state UNINITIALIZED->COUNTRY_UPDATE wlp11s0: interface state COUNTRY_UPDATE->ENABLED wlp11s0: AP-ENABLED WPA_TRACE: eloop SIGSEGV - START [1]: ./git/hostap/hostapd/hostapd(+0x6c196) [0x55b270245196] eloop_sigsegv_handler() ../src/utils/eloop.c:123 [2]: /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f87574a7210] [3]: ./git/hostap/hostapd/hostapd(hostapd_wps_config_ap+0x1a9) [0x55b2702ce349] hostapd_wps_config_ap() ../src/ap/wps_hostapd.c:1970 [4]: ./git/hostap/hostapd/hostapd(+0x90a9f) [0x55b270269a9f] hostapd_ctrl_iface_receive_process() ctrl_iface.c:3606 [5]: ./git/hostap/hostapd/hostapd(+0x94069) [0x55b27026d069] hostapd_ctrl_iface_receive() ctrl_iface.c:4093 [6]: ./git/hostap/hostapd/hostapd(+0x6c6d3) [0x55b2702456d3] eloop_sock_table_dispatch() ../src/utils/eloop.c:606 [7]: ./git/hostap/hostapd/hostapd(eloop_run+0x251) [0x55b2702461c1] eloop_sock_table_dispatch() ../src/utils/eloop.c:597 eloop_run() ../src/utils/eloop.c:1229 [8]: ./git/hostap/hostapd/hostapd(main+0xd53) [0x55b270205773] hostapd_global_run() main.c:447 main() main.c:892 [9]: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f87574880b3] [10]: ./git/hostap/hostapd/hostapd(_start+0x2e) [0x55b2702058fe] _start() (null):0 WPA_TRACE: eloop SIGSEGV - END Aborted Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Masashi Honma <masashi.honma@gmail.com> --- src/ap/wps_hostapd.c | 5 +++++ 1 file changed, 5 insertions(+)