From nobody Wed Nov 15 15:38:29 2023 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 4SVnPd47Dpz50QHb for ; Wed, 15 Nov 2023 15:38:29 +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 4SVnPd1mSkz3RQj for ; Wed, 15 Nov 2023 15:38:29 +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=1700062709; 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=znQB+UnmZM3PCq9gwDCcQPX1jRJqBZ3QhsQDGluq/oQ=; b=o4GMBP49lDvBims+uIbE+/6LfKlcodN4Q+ZfvtNgsozmHvvWdzvypN7lsNrB0Q34d/eTOp zTDNF3vprVe5SAbbDsp41Oj1kXZ9/AvsN0i6uMDGT7livrNcNIRRb2HhkW2R3M5HEzToBC 4wJDfIvDP3PGUmDMtaFg60ZAvkRLJh0Lp7HOfklzytL9GGAZgJF+RHF0Y3PivdKwlWzoMy ckbMWt9h9U1bX2beBQ/Sojlcyh2YCyCn/oeRsgGhuIqd5gGfo26MymZDksPLS88lJPA2Wv Y/uszr5j4g0oPswZpPTNu27nxQ0G8JzVPxS4N91scoWxd4uEOFWIERzDeKWg4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700062709; a=rsa-sha256; cv=none; b=Z8j2SFiGYV24eHpwxHu79VHsvjjezhlVB8hYatT2VT/fneG3C3wyEVsS8CaeHXj8ILeb3U JXweuwRBTnrWxU3ltqnJfAlmCl8cfO4z8OEckkbD5YObLJgWlUCok3Vvm48GrEYpJClldY nApqnNx7md9b7CJTfdru6AhLwoBfryCG+7zYCP88yIxb8t5yf7oCEigy5HOOVsRqBHdoca anVsGCvsYwguWCIEAejgsXUucpFUwkdWGClSLgO3YFyFmex/dnJ154a9H1s/8vHZGUFmcq RPFkPe+JzId31OWfdyQGlp3aj+JW1aqXSYbRrxIkcV2SOFPEUfwA7DPpTHhJlA== 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 4SVnPd0mY3z70G for ; Wed, 15 Nov 2023 15:38:29 +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 3AFFcSIo015599 for ; Wed, 15 Nov 2023 15:38:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3AFFcSC1015598 for bugs@FreeBSD.org; Wed, 15 Nov 2023 15:38:28 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 275106] [regression] ng_ksocket(4) produces kernel panic Date: Wed, 15 Nov 2023 15:38:29 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: crash, regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: eugen@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc 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: 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275106 Bug ID: 275106 Summary: [regression] ng_ksocket(4) produces kernel panic Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Keywords: crash, regression Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: eugen@freebsd.org CC: afedorov@FreeBSD.org, glebius@FreeBSD.org Let's start ngctl without arguments (interactive mode) and run the following commands to create ng_ksocket(4) instance listening tcp/9 port and connecte= d to ng_hole(4) to implement TCP "discard" service for demonstration: mkpeer hole dummy dummy name .:dummy hole mkpeer hole: ksocket hohook inet/stream/tcp name hole:hohook kso # setsockopt(SOL_SOCKET, SO_REUSEPORT, 1) msg kso: setopt { level=3D0xffff name=3D0x0200 value =3D [1] } msg kso: bind inet/0.0.0.0:9 msg kso: listen 1 msg kso: accept For FreeBSD releases before 12.0, it works: one can do "telnet localhost 9"= to make connection to the port. Also ngctl command "shutdown kso:" works just = fine thereafter. For FreeBSD versions after 12.0-RELEASE, "shutdown kso:" works if we run it before "msg kso: listen 1". After that stage, "shutdown kso:" produces inst= ant panic: Fatal trap 12: page fault while in kernel mode cpuid =3D 0; apic id =3D 00 fault virtual address =3D 0x18 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff80b26298 stack pointer =3D 0x28:0xfffffe00085ff9c0 frame pointer =3D 0x28:0xfffffe00085ffa00 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 730 (ngctl) rdi: 0000000000000000 rsi: fffffe00099651e0 rdx: 0000000000000000 rcx: 00000000000003aa r8: 0000000000000001 r9: 0000000000010000 rax: fffff80004064b40 rbx: 0000000000000018 rbp: fffffe00085ffa00 r10: 0000000000000001 r11: 0000000000010000 r12: 00000000000003aa r13: 0000000000000000 r14: fffff8000352c400 r15: ffffffff823256a5 trap number =3D 12 panic: page fault cpuid =3D 0 time =3D 1700061288 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00085ff= 780 vpanic() at vpanic+0x150/frame 0xfffffe00085ff7d0 panic() at panic+0x43/frame 0xfffffe00085ff830 trap_fatal() at trap_fatal+0x40a/frame 0xfffffe00085ff890 trap_pfault() at trap_pfault+0xae/frame 0xfffffe00085ff8f0 calltrap() at calltrap+0x8/frame 0xfffffe00085ff8f0 --- trap 0xc, rip =3D 0xffffffff80b26298, rsp =3D 0xfffffe00085ff9c0, rbp = =3D 0xfffffe00085ffa00 --- __mtx_lock_flags() at __mtx_lock_flags+0x48/frame 0xfffffe00085ffa00 ng_ksocket_shutdown() at ng_ksocket_shutdown+0x39/frame 0xfffffe00085ffa20 ng_rmnode() at ng_rmnode+0x188/frame 0xfffffe00085ffa50 ng_apply_item() at ng_apply_item+0x4fb/frame 0xfffffe00085ffae0 ng_snd_item() at ng_snd_item+0x2cc/frame 0xfffffe00085ffb20 ngc_send() at ngc_send+0x1b3/frame 0xfffffe00085ffbc0 sosend_generic() at sosend_generic+0x5fe/frame 0xfffffe00085ffc70 sousrsend() at sousrsend+0x79/frame 0xfffffe00085ffcd0 kern_sendit() at kern_sendit+0x1c0/frame 0xfffffe00085ffd60 sendit() at sendit+0xb7/frame 0xfffffe00085ffdb0 sys_sendto() at sys_sendto+0x4d/frame 0xfffffe00085ffe00 amd64_syscall() at amd64_syscall+0x139/frame 0xfffffe00085fff30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00085fff30 --- syscall (133, FreeBSD ELF64, sendto), rip =3D 0x556e6b62ffa, rsp =3D 0x556e4385f98, rbp =3D 0x556e4385fe0 --- KDB: enter: panic [ thread pid 730 tid 100070 ] Stopped at kdb_enter+0x32: movq $0,0xde93a3(%rip) db> I got this panic using somewhat old 14.0-CURRENT system running in my bhyve. This bug makes it impossible running net/mpd5 as PPP over TCP server as mpd5 uses ng_ksocket. --=20 You are receiving this mail because: You are the assignee for the bug.=