From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796235482; b=lJfSneb4xImCCVlosJbm5VcyCSLQ9GGkSFxWFIFsK6jMFRh/Y5ogeFN6jdrsHIJQaC40 p67lzSIENJANq6N2KblwPISaD2eDiN5a3XUmgLB7tFF88PKjKyLqOx2cAvGvrZWjPPH6U yZw2s3OefZPY8s/KlQL2U5UILOSByaihua5Zgvpavj9TF8LoMYZyvLQUbE04oax+DG5ff gVmMBVpl+3rUF8DKZcCkxwT09nG1TgcFOvTQ5pCNj+YiCIKqEu4k/rNI6LlUnsiz6q4Qx uCK5FX10PpWRaT77/eB18g076TlevdcNbUF5u2NtseGf82b3WTDy/7CFTLG1hTD2K7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796235482; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=rTaIGwgApcPOh15wq0p/NXNNq2feFZB2HoOctuMeajU=; b=z/MSbDXSDW1vwbGW8MAAcM1JaPPneil0/o+GgMvld09tuE8XU2UMpJYR4BdQKcMMnrY4 UIGnh3E00FMJTBQ5m79/S7DMpP5x8SwBIkFEfo2i8n5vHHWNsQGLUko1cWzZ2yCC0vZgK 9KAlb52nJi8euGQPXVO7fViY2eP17ndQfqzHJnms53GUVWouwEHirL85itG6ryto3LAVW puPwXcP41nsw44ZTG30JLXsxagBiXrHjCMF+wT3UGqWxprjP8ZPoPZwWV+h+zEjvg6SKI +53ZkSTl09BYN+GhoqAEU9XMc9BrKfpaflkb50g9RfjKp2cGKXDAJp/E9z3m7DMrwjA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F3YbfpEX; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC4E5606A335 for ; Wed, 2 Dec 2026 18:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F3YbfpEX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60EA81F00897; Wed, 2 Dec 2026 18:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796235482; bh=rTaIGwgApcPOh15wq0p/NXNNq2feFZB2HoOctuMeajU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=F3YbfpEXC3VvYG62VFScfeQW8IwFppW9O3yGDr5KktR6VuJMyDSLzYV8M17TGLoUL hQLRbvsdzhHnXL5Zb88IoDMFt52k24EtPSGoFAnHps9qTXR2WKuBJfKJ3L3SgwcpR8 7Dq4yHPF0E50fBU/mTVr0/rY5v5cufJCCJncbV1DuuyfCF3KwFGkW8RGbc2Kg82E4R QLMaNlNtcpU4kz1wUE5Ywyj4UnQE2NR31FACo4oYgQAt3mGkS/pZJZH2s+T+q87V9W p6jMNPOq8rodILIIF6PqsXFSO4TYGLm9P58ij0VZT1sXOzlfE2qwbRZwYKEEa1AKSv RO53hFXtQ5ktQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] tty: n_tty: hold termios_rwsem in n_tty_lookahead_flow_ctrl() Reply-To: sashiko-reviews@lists.linux.dev To: "Jiayi Zhang" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261202180854.4154340-1-zhangjiayi1014@gmail.com> References: <20261202180854.4154340-1-zhangjiayi1014@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 18:18:01 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > syzbot reports a data race between the XON/XOFF lookahead and TCSETS: >=20 > BUG: KCSAN: data-race in n_tty_lookahead_flow_ctrl / tty_set_termios >=20 > write to 0xffff88811a4798e0 of 44 bytes by task 9666 on cpu 1: > tty_set_termios+0xc0/0x900 drivers/tty/tty_ioctl.c:335 > set_termios+0x36e/0x4b0 drivers/tty/tty_ioctl.c:516 > ... > read to 0xffff88811a4798fa of 1 bytes by task 9026 on cpu 0: > n_tty_is_char_flow_ctrl drivers/tty/n_tty.c:1196 [inline] > n_tty_receive_char_flow_ctrl drivers/tty/n_tty.c:1217 [inline] > n_tty_lookahead_flow_ctrl+0x1b0/0x2d0 drivers/tty/n_tty.c:1492 > tty_port_default_lookahead_buf+0x91/0xc0 drivers/tty/tty_port.c:59 > lookahead_bufs drivers/tty/tty_buffer.c:435 [inline] > flush_to_ldisc+0x28b/0x350 drivers/tty/tty_buffer.c:505 > [ ... ] > Reported-by: syzbot+0479f67e520e4910d370@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=3D0479f67e520e4910d370 > Reported-by: syzbot+2430ce6b487fe0119d03@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=3D2430ce6b487fe0119d03 > Signed-off-by: Jiayi Zhang Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202180854.4154= 340-1-zhangjiayi1014@gmail.com?part=3D1