From nobody Sun Feb 05 18:22:18 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 4P8yRH0v8pz3khLb for ; Sun, 5 Feb 2023 18:22:19 +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 4P8yRG5nt9z4G8b for ; Sun, 5 Feb 2023 18:22:18 +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=1675621338; 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=aD2JrieiBVFFCEfRqIhPN5UUeFTdZYjWJW2qCuzgRpk=; b=v3usLgSlab4ZBHbVzzOW0e87XcbvEv33OnmuNH6zjgHHHepmmRmhlYtHL83OjDeLEcFrTk +mMmt/EdslouHp3gZfcLziNqAZQBwOkbjqzXV1FJylA0x+BX+CfJlePPcp+XdskGX/9rYT nlfG+B79p6blek0paWnY6lmC0vMD0lrcwVwNuF2Feb9fdJo+AHwkO+0ONZ2uqEP8vK5mvR ZyzDj8LIxxUv7+ZRnSMA1Knesl0vR6qxh1KGf+BFiedL/97lwPzMX3ndOvu07jMzKEcam7 9/hUixWEgKGv8l3Wseq78JUOUaT0KHFotPu5WXkXQQXhIG3DepIHY8+NdmP51Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675621338; a=rsa-sha256; cv=none; b=tG8D3AM1ympdMVXx2g3qwzCD1qC9ZDvlIBFWFyMuIegUfkJkMpwv+68EizB2lb0KFPXLEZ rpGtq6Le5J7CUp5SaTaX/ra+z9S7ZRnoa30LS8B5xQisLd2h9QpZCBd3W/wdUwisduz1lX 1+z9r2Mj9ybMLNl8c5v+Sd9JEid3PiWPYxf7wavBUJO4TXZaq5cnU848kIYpjxHge3apGx 0POOFut7bb7Oaij2vsl7fRKYMalTZhToKkjBFrqI69N1Wy5A4IssCuWx+E7rktKcFr74nY hzv3R0ITeC2vX9FhUtoBsNZtZtMYXs4uh16+/ci1RCJA8BUFtTJZRxS2b85dVQ== 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 4P8yRG4vl7z14Y9 for ; Sun, 5 Feb 2023 18:22:18 +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 315IMIGU000586 for ; Sun, 5 Feb 2023 18:22:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 315IMIpU000585 for wireless@FreeBSD.org; Sun, 5 Feb 2023 18:22:18 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 269343] bad 802.11 mesh PREQ packet can generate panic: null node from hwmp_send_action() Date: Sun, 05 Feb 2023 18:22:18 +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=3D269343 Bug ID: 269343 Summary: bad 802.11 mesh PREQ packet can generate panic: null node from hwmp_send_action() 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 #239923 text/plain mime type: Created attachment 239923 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D239923&action= =3Dedit generate an 802.11 mesh action PREQ frame that causes panic: null node I don't understand the scenario, but the attached demo program generates an 802.11 mesh PREQ action packet that triggers this panic in hwmp_send_action(): // da is 00:00:00:00:00:00 if (IEEE80211_IS_MULTICAST(da)) { // not this } else { ni =3D ieee80211_mesh_find_txnode(vap, da); // now ni =3D=3D NULL } ...; KASSERT(ni !=3D NULL, ("null node")); The call from hwmp_recv_preq() to hwmp_send_prep() is the one on line 1177 of ieee80211_hwmp.c; rtorig->rt_nexthop is 00:00:00:00:00:00. /* * Proactive PREQ: reply with a proactive PREP to the * root STA if requested. */ if (IEEE80211_ADDR_EQ(PREQ_TADDR(0), broadcastaddr) && (PREQ_TFLAGS(0) & IEEE80211_MESHPREQ_TFLAGS_TO)) { ...; /* * Reply with a PREP if we don't have a path to the root * or if the root sent us a proactive PREQ. */ if ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) =3D= =3D 0 || (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) { ...; hwmp_send_prep(vap, rtorig->rt_nexthop, &prep); The demo: # cc wtap19c.c # ./a.out ... wlan0: [00:98:9a:98:96:98] received PREQ, orig ff:ff:7f:ff:ff:ff, targ(0) ff:ff:ff:ff:ff:ff wlan0: [00:98:9a:98:96:98] adding originator ff:ff:7f:ff:ff:ff wlan0: [00:98:9a:98:96:98] root mesh station @ ff:ff:7f:ff:ff:ff wlan0: [ff:ff:7f:ff:ff:ff] stored new gate information from pro-PREQ. panic: null node panic() at panic+0x2a hwmp_send_action() at hwmp_send_action+0x2e0 hwmp_send_prep() at hwmp_send_prep+0x2a hwmp_recv_preq() at hwmp_recv_preq+0x76e hwmp_recv_action_meshpath() at hwmp_recv_action_meshpath+0x29a ieee80211_recv_action() at ieee80211_recv_action+0x13c mesh_recv_mgmt() at mesh_recv_mgmt+0x202 wtap_recv_mgmt() at wtap_recv_mgmt+0x28 mesh_input() at mesh_input+0x512 .LBB2_17() at .LBB2_17+0x34 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.=