From nobody Sat Feb 04 18:34:03 2023 X-Original-To: wireless@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 4P8LlJ0CFnz3njQ5 for ; Sat, 4 Feb 2023 18:34:04 +0000 (UTC) (envelope-from bugzilla-noreply@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 4P8LlH54qNz3G6n for ; Sat, 4 Feb 2023 18:34:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675535643; 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=S1oK2P2h28bcylvBMNcogpG63PZD3k+ERtwj0nbctGs=; b=nTwMniIfjsC0qUD0uoYmMxxqav+robOdMRjsSaHAzu1CvfawIVnWhiYZuT88cYGTLIh/xd j2N8cOR5Hec3Ia55v/bzz+kT6ymvtMqhDObgMgxUh9h2ETd4xph2jgA7/Hyvc22Hx8MHAG p7dSz1BB5JhLn4PzHCj4YBWtGfhInhCNO8bl9JTjVFpZ618RN1uBc3v+vxT8Wc7gTTo/M8 IwmQXFXJexaIgVJY9X4G31yMFNoeLmi2/Un+lPtdUVTakUqzak/Ws0ltZVezD1zTtf8MWT ZUt0S8Vk2jSSJ4m4+EgpBWcJ+q4YuMkdnVSI6+SqQ4THuP7KWOYdKOzCvEcUQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675535643; a=rsa-sha256; cv=none; b=G3xABY1TVJ2YN+TVKYewlKRkUpSmwhpoeYxVTlst9+R8J+vJ7UxjLAhvfS6F6g3rxGpyAq UJclLAOaQx6BRAzEd71tWdU0va23/FFZEvYhZfAUHs7Xhi819Sz4wIlpr36hothHxfmYrS lnEnpo7ncluhpGvnaaX/Dne3UQrg5WgVb5wEi/t73WmjdFz7Z5kyT4KT/bsu/Q6Q/lheLb A6fNFKOqza99pEKCh/c7spmuexJWtF8c7b4QIpwTqmqP+TKvNpqGItW9Ny8CIaDFgT62l/ kJsZjfYAQ54Uenwxpe6qm9p0mk+g1SYbZrad/cWqapkQ1CC09lMlgun1SaCGHQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4P8LlH48pdzQ9Z for ; Sat, 4 Feb 2023 18:34:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 314IY3D5025689 for ; Sat, 4 Feb 2023 18:34:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 314IY3A8025688 for wireless@FreeBSD.org; Sat, 4 Feb 2023 18:34:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: wireless@FreeBSD.org Subject: [Bug 269323] potential NULL dereference in ieee80211_send_probereq() Date: Sat, 04 Feb 2023 18:34:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: wireless@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269323 Bug ID: 269323 Summary: potential NULL dereference in ieee80211_send_probereq() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: wireless Assignee: wireless@FreeBSD.org Reporter: rtm@lcs.mit.edu Attachment #239907 text/plain mime type: Created attachment 239907 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D239907&action= =3Dedit inject an 80211 packet that provokes a NULL deref in ieee80211_send_probere= q() In response to an arriving packet, adhoc_input() in ieee80211_adhoc.c can set ni to NULL and then pass it to ieee80211_send_probereq(), which tries to dereference it. if (ieee80211_ibss_node_check_new(ni, &scan= )) { ...; } else ni =3D NULL; if (! (ic->ic_flags & IEEE80211_F_SCAN)){ ieee80211_send_probereq(ni, /* node= */ vap->iv_myaddr, /* SA */ ni->ni_macaddr, /* DA */ vap->iv_bss->ni_bssid, /* B= SSID \ */ vap->iv_bss->ni_essid, vap->iv_bss->ni_esslen); /* SSID\ */ } I've attached a demo, which needs to be run twice: # cc wtap2a.c # ./a.out # ./a.out ... panic: Fatal page fault at 0xffffffc00043afea: 0000000000000000 panic() at panic+0x2a page_fault_handler() at page_fault_handler+0x1d6 do_trap_supervisor() at do_trap_supervisor+0x74 cpu_exception_handler_supervisor() at cpu_exception_handler_supervisor+0x70 --- exception 13, tval =3D 0 ieee80211_send_probereq() at ieee80211_send_probereq+0x20 adhoc_recv_mgmt() at adhoc_recv_mgmt+0x5b8 wtap_recv_mgmt() at wtap_recv_mgmt+0x28 adhoc_input() at adhoc_input+0x990 ieee80211_input_mimo() at ieee80211_input_mimo+0x6e ieee80211_input_mimo_all() at ieee80211_input_mimo_all+0x52 ieee80211_input_all() at ieee80211_input_all+0x44 .LBB2_14() at .LBB2_14+0x1e taskqueue_run_locked() at taskqueue_run_locked+0x96 taskqueue_thread_loop() at taskqueue_thread_loop+0x62 fork_exit() at fork_exit+0x80 fork_trampoline() at fork_trampoline+0xa --=20 You are receiving this mail because: You are the assignee for the bug.=