From nobody Thu Jun 22 16:30:42 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 4Qn5TG6DFBz4gcHQ for ; Thu, 22 Jun 2023 16:30:42 +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 4Qn5TG4Wzcz4NXY for ; Thu, 22 Jun 2023 16:30:42 +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=1687451442; 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=CG6FsXv4bz9UZVFuIr7+b0Rfhd6TrHtQc1Oeqgz1CIM=; b=ox8NfndHk1OZUnX5vgXTbwp6oUVvh2LRWHWfqBzs0kgpzQ2NuxR4m8HroCZhfbZfw8aDnn Dx5imRTEx2alKVuZsM0bne2RZxK8SArAvjrq9CebNmskTD3FS+/7a2Fdgj1v6C2Sb5llIG Jn4ga5uP7S+AsW3mnSmFTbOMzDLRyn4LBMvcXu8MGdjxEdKTJLb3NtkbeD6SD7TAVgNuNU dul5cQeyE+Eqifszgm0LeLWazUXEVGhmPCZ2vO79k8UC2LcmWxpN8sgS+fGGBDb+VKEhsw ogVIV/ukFBqG7DpsmXP9HBAgSu/bhjW1xF+of2vluGGlREwWAmY2bN7qCnWheQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687451442; a=rsa-sha256; cv=none; b=D/eChqrcZ0rZpWp1xhE7u/kHrWwsMC79yaZY+MAHsj6OaEdArC7fbvAenuG6szbp4d4KL2 3nYlrEf4Szrj2jKY5sOfbTubxM8d6njr7faCXTLjcyi3soQ7qgy1hrmtGjwkIN+VeN784Z n+/4vi/yfi5z3sEP3ZJU5Qs+dl9xQBubl0iZB/BZO0hzqAoLPMW4ZqyTGtmthPWfrWrXZc S3RjyqH0UWWqrWoy1SV1X/3ruB36A+o/zdFB/PqNSxvDBJhHHSi5bV/c5ZjkXkAGp1N+K3 z5VnCkrk9xKPu0Yato2P6XbbpRvTIRaZBJM/nHMDKoWCm3f2iwu/roNvXDIP+g== 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 4Qn5TG3fFMzVPj for ; Thu, 22 Jun 2023 16:30:42 +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 35MGUgw3098232 for ; Thu, 22 Jun 2023 16:30:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35MGUgeN098231 for bugs@FreeBSD.org; Thu, 22 Jun 2023 16:30:42 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 272151] panic: use-after-free tty race condition Date: Thu, 22 Jun 2023 16:30:42 +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: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: jake@technologyfriends.net 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 bug_severity priority component assigned_to reporter 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272151 Bug ID: 272151 Summary: panic: use-after-free tty race condition Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jake@technologyfriends.net There appears to be a race condition during shutdown where the tty is no lo= nger owned by the current thread, resulting in an assertion panic. I was unable = to dump for more information, but this panic has happened to me several times,= so I will update the report with the dump info next time that it happens. Here is what I was able to record: Jun 20 22:11:22 freebsd shutdown[80834]: reboot by root: Stopping cron. Waiting for PIDS: 808. Stopping sshd. Waiting for PIDS: 804. Stopping devd. Waiting for PIDS: 491. Writing entropy file: . Writing early boot entropy file: . . Jun 20 22:11:22 freebsd syslogd: exiting on signal 15 panic: mutex ttymtx not owned at /usr/src/sys/kern/tty.c:720 cpuid =3D 1 time =3D 1687317082 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe018d934= 860 vpanic() at vpanic+0x150/frame 0xfffffe018d9348b0 panic() at panic+0x43/frame 0xfffffe018d934910 __mtx_assert() at __mtx_assert+0x9c/frame 0xfffffe018d934920 tty_kqops_read_event() at tty_kqops_read_event+0x2b/frame 0xfffffe018d934940 kqueue_register() at kqueue_register+0x8ee/frame 0xfffffe018d9349c0 kqueue_kevent() at kqueue_kevent+0x109/frame 0xfffffe018d934c90 kern_kevent_fp() at kern_kevent_fp+0x95/frame 0xfffffe018d934ce0 kern_kevent() at kern_kevent+0x80/frame 0xfffffe018d934d40 kern_kevent_generic() at kern_kevent_generic+0x6f/frame 0xfffffe018d934da0 sys_kevent() at sys_kevent+0x61/frame 0xfffffe018d934e00 amd64_syscall() at amd64_syscall+0x130/frame 0xfffffe018d934f30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe018d934f30 --- syscall (560, FreeBSD ELF64, kevent), rip =3D 0x824b57b4a, rsp =3D 0x82= 1235e38, rbp =3D 0x821235e80 --- KDB: enter: panic [ thread pid 2920 tid 100767 ] Stopped at kdb_enter+0x32: movq $0,0xde1c73(%rip) db> dump Dump failed. Partition too small (about 2697MB were needed this time). Cannot dump: unknown error (error=3D7). --=20 You are receiving this mail because: You are the assignee for the bug.=