From nobody Wed Oct 26 21:28:58 2022 X-Original-To: bugs@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 4MyMPk18Jfz4g78l for ; Wed, 26 Oct 2022 21:28:58 +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 4MyMPj602nz4D5f for ; Wed, 26 Oct 2022 21:28:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 4MyMPj543PzY0T for ; Wed, 26 Oct 2022 21:28:57 +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 29QLSvPg032436 for ; Wed, 26 Oct 2022 21:28:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29QLSv1M032435 for bugs@FreeBSD.org; Wed, 26 Oct 2022 21:28:57 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: bugs@FreeBSD.org Subject: [Bug 267294] inquiry_result() in ng_hci_event.c ought to check before calling m_copydata() Date: Wed, 26 Oct 2022 21:28:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern 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: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666819737; 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: in-reply-to:in-reply-to:references:references; bh=QEZULHkaU177jSiZ7vNFssw51rm8iEbXOlA9mnpXejQ=; b=Sh0+sO4Dj6fLbu1QVJ0eSdbe+LRlby59ijl4nE4oK6LTntf9y10dms7wE8D7R7o6/go26F 3OpOk81mExkd5NvlQqSRnotFFu+2/c+ME0wVpuCvVzLV+FJLh6Cq8SD3x/YF+Xw8Kufw/X GNM2bhfdNKgJeuxGdI3smcFhUogAlPIB4OPcGeXsCn8z2ZSrXxZRv19RrXdVeKC6ss4paH fMZEeVqjKS/XxhnYcmWni47e20kmW49QiJ4E00EXC8yT0tLFbmJzHoGj/TJ56HzmUz8Eui 3jJkWHmX2HXF9I9yAbR0kjUj+Bo0g7sZwE1Zi1q1mP+hUCQAy5KjjLYTn8bHQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666819737; a=rsa-sha256; cv=none; b=xSlnbSOHtKhTX1/rE/nNwKnmFEmYHM5/am3u29c7S5aT0nG1fn9VQWZMBo21JwH435DSNd +4ynwAQrjTSODX2DvZSN28HllOmaP41DCUzIzg7O2bSoVE7BnOGjBErClqZdztbEeM42QA +qDTZA1w5C/kzobOhhwFF8Iiw9wxdj6vDV3KudRmHrzvludkg8zRpC1WgJ8Uvob/Ii/afu yY2mFmOKOe5d0KZEHBxkTLm6GDqDLmOqSJh7WpjEOhkbk/2rMjjS2hsTMHwyn64QkrwQAs hs1imFIQCkGydIy+tB86Gl7IeC3ui1E8eVlfYn5jboCilQmpN677D0rC7a1FRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267294 --- Comment #1 from Robert Morris --- The m_copydata() calls in num_compl_pkts() in ng_hci_evnt.c can also panic. Here's a demo program: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(){ setlinebuf(stdout); struct rlimit r; r.rlim_cur =3D r.rlim_max =3D 0; setrlimit(RLIMIT_CORE, &r); signal(SIGPIPE, SIG_IGN); system("kldload netgraph"); system("kldload ng_hci"); int cs =3D -1; int ds =3D -1; NgMkSockNode(NULL, &cs, &ds); struct ngm_mkpeer mkp; memset(&mkp, 0, sizeof(mkp)); strcpy(mkp.type, "hci"); strcpy(mkp.ourhook, "hook"); strcpy(mkp.peerhook, "drv"); if (NgSendMsg(cs, ".:", NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { fprintf(stderr, "netgraph mkpeer %s %s failed\n", mkp.type, mkp.peerhoo= k); } char buf[128]; memset(buf, 0xff, sizeof(buf)); *(long long *)(buf + 0) ^=3D 0xecfb; NgSendData(ds, "hook", (unsigned char *)buf, 116); } --=20 You are receiving this mail because: You are the assignee for the bug.=