From nobody Fri Nov 26 14:25:01 2021 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 AF27318A4B16 for ; Fri, 26 Nov 2021 14:25:02 +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 4J0xpj2msCz4d5x for ; Fri, 26 Nov 2021 14:25:01 +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 194132383 for ; Fri, 26 Nov 2021 14:25:01 +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 1AQEP1Wo080526 for ; Fri, 26 Nov 2021 14:25:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1AQEP1XJ080525 for bugs@FreeBSD.org; Fri, 26 Nov 2021 14:25:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 258994] iic(4): Panics on Nanopi Neo when using 16-bit device addressing width: panic: Assertion strlen(description) < MAX_W_NAME failed at ... sys/kern/subr_witness.c:1914 Date: Fri, 26 Nov 2021 14:25:01 +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: 12.2-RELEASE X-Bugzilla-Keywords: crash, needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? mfc-stable13? mfc-stable12? 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=1637936701; 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=4rMwSFIZc6gv+PK022dXzcVXEO5DMB2FlmEJuJJImrs=; b=Ms1cGanG8NJQnXErliMS7KKMNabqgerApG5mSIqW0qncvxNSGcXMidwvfG2/on88xFPDdR 5p8A7DkgSvVxac6q3NzHTyTOuaW2cGRva9pjJ20JtINtucPaNuhQ0doG2g4IikyoWqh7Vl GuPPFby15JUDoDicee65IZlRPQ0FxKZ44/BEAA5CM51Sc11pXU14QxnIhRHu1sAci9e7/B ZCHssZuYCLSwoOp1Im34sA9DNB0w3WoWEhdVb4WD5vxzD6aSb+E6ObiG+V9JjCgs4tIC/9 MISI7ruARQoXdkqqSnRnPuNTZvKmAAbEbeHOcnzXijTnGDlet4PrngTq8OI7GQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637936701; a=rsa-sha256; cv=none; b=eikMN1ayK+gkMiGgtI2I0LuEr5hpg4WIst2dQaIvMf5aRyFaz+NfLNfRXBwpOztdjO/4As 6kkpW3tNy5IbO37sfthYGdKvQna+9XBXhLEG74NnrD2N1icl/VXKzLlwWgXmZ8eZcIhn1i szyAkchUIrEZFZ6xBGBqL70ddclG2WHXZV1hilHJcjz/kaNlfymXytVJEwHhwZt6z3V8bh TZefabygR2tr4S4lN0X/ljMAberthRj8ExTKGKMEwm+lrKNrfSCiiOTxhfD45QLqE+RH3H ER17NhduMzpAnGXIGZ/5j+LOBOaJbVil3jHgw+YMwAKby92szDA0vrVAdkDw7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258994 --- Comment #17 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D04622a7f21157827fe75276a4520a52d3= a571a86 commit 04622a7f21157827fe75276a4520a52d3a571a86 Author: Andriy Gapon AuthorDate: 2021-11-26 08:07:27 +0000 Commit: Andriy Gapon CommitDate: 2021-11-26 14:17:24 +0000 twsi: move handling of TWSI_CONTROL_ACK into the state machine Previously the code set TWSI_CONTROL_ACK in twsi_transfer() based on whether the first message had a length of one. That was done regardless of whether the message was a read or write and what kind of messages followed it. Now the bit is set or cleared while handling TWSI_STATUS_ADDR_R_ACK state transition based on the current (read) message. The old code did not correctly work in a scenario where a single byte was read from an EEPROM device with two byte addressing. For example: i2c -m tr -a 0x50 -d r -w 16 -o 0 -c 1 -v The reason is that the first message (a write) has two bytes, so TWSI_CONTROL_ACK was set and never cleared. Since the controller did not send NACK the EEPROM sent more data result= ing in a buffer overrun. While working on TWSI_STATUS_ADDR_R_ACK I also added support for the zero-length read access and then I did the same for zero-length wri= te access. While rare, those types of I2C transactions are completely valid and are used by some devices. PR: 258994 MFC after: 3 weeks sys/dev/iicbus/twsi/twsi.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=