From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.9 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796459169; b=kgJRmOuxZfKyNOYKEqu+GUoyblrJwWRflShOnlZDXSoPt5BVVgFgaYMRQOin5rAbiQMy VV8nrQQZiJcdwKdX3WD2gvt//FWNgldfGupVcIGexrxm2WusgWPbS1zma+uSiddmBK//e xYUntFStxreEPmU5CBOkJNzNUZl6+1Aw7LPF5PTv8tAJrCqClDfQzoZwY5GWhqVNnfn76 2fsgcdlcbsxfMdy7wZAoqF8p5RrUu+WW0PpUtgyuGPKYymK7Om87xEIVUQ/dTtxw0Kq5a pQYoF1lTAC8DzHHBFqLMmH5wtzKjIZJIitkGuFdaBEcw/LwLUoHuWJ+TN7fbYeBpjQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796459169; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=ulyhEBrCTOIkUz/d5vml6Gp5vFEiBjSX3PXbLEoXiMw=; b=MgNwjw2dliXO5Re2p979TdzW2VSdiMhUDW7H0C+VX2d55/7NNum6cvlo10xY5TPe3898 jBvsEhkSKJxCIhfJYTJjWxDIwU4UUx2zmS4bOdV+kGkIXGnOsgiQqshdiglnddFHHR3sy 34TWFlDbQs4lwZTzxW8VzEwsOoLDZNMWJWWjJf9qct24z1BLQahaUSfoGVLbffIAVzlaG Fai8awN5sNSMCtbruH/gx+rj3MHeOcBPC6CjU4JKZ6OLTQPJ8k+QccJEKMQmPLkldh+6D WMDJ/Ut5dIUW4iGXOCPnK3gWF/aoHoTClqeJD5B3H8QyYZ1DNdVfqVY1gtFiMfrnF6w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XH41GT4H; arc=none smtp.remote-ip=74.125.229.9 Received: from mail-dy2-f9.google.com (mail-dy2-f9.google.com [74.125.229.9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D30A606A32F for ; Sat, 5 Dec 2026 08:26:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D30A606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XH41GT4H Received: by mail-dy2-f9.google.com with SMTP id 5a478bee46e88-3678f64d078so1331063eec.1 for ; Sat, 05 Dec 2026 00:26:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796459168; x=1797063968; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ulyhEBrCTOIkUz/d5vml6Gp5vFEiBjSX3PXbLEoXiMw=; b=XH41GT4H+JFa0wbOwR7b8kh9cjj5bIj6Pi1JIm6jgXOq2O+ZfzLeJ2mtTxn6zYMJtJ M+wPoNwKS9O63w0hrJPlw09QNJw21lsSeXN7UyLZPL4nIp2S5/2dH3wKOCK1w4NoAFQR p0N9P4LqWyyzttkv3WjN0XG+eTc6V53ekuvJ0TpD6NUJrr6okvXV8AJo4kUXark5xGQP 2U/twyYe1z/EJ0DWjVPQfe9TVNZZkQtpx2ySAhiBMe3N7cwAqgwhJxlIVdBCCzKhf+/Q c2lDgmXIJlBPdgB9Lt2OPCdl0aPLwQC0JZasRJAwgQQqldnOQid9qc8nwp5XjKVv0pxO mL+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796459168; x=1797063968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ulyhEBrCTOIkUz/d5vml6Gp5vFEiBjSX3PXbLEoXiMw=; b=zb2sHVXWjBh0f+eSOWg+vdOdmkQ0FzochMdwF05pnzyUZe/kEesP7DICKgKk0hAVIY N4fUQnhx4GRNvSabIDwjtmTXC6lHJm9uzzQJEOfGrfRbAyBn2cfFiQhG3zQGJgNl6oto sGc0C/5DzjNL8e6RJSbhaF9I/+YxB5qw/WcdFv6XR3n6KVNvnb4I2NS86UN/QdOGGM5X K5HSaV+mSfwurrGTTzKTLHaLvUUj9YZTRIGnCnJGXPJMYTVkjh1U5nPJ3yZNpeYzjgl0 +pZArXIrFS2GthiIuN0tkno04/ZXh+ZmD9xh4RZ44P7UQRnzkO0Foxa3Q3n5snDCZzzj cu/w== X-Forwarded-Encrypted: i=1; AL+hErGTn9xLCo2zn9CIpc3bcin4Mn8ope5u+g4ffUxmSgKHyPh+EIY2sBDkbbsxfG8pMQaTHyynFjUA8uI2DNc=@vger.kernel.org X-Gm-Message-State: APuU4Z9+W/XtvRCgfenvH/QpGd3sQIHtLEfnysTa1XZpJ5miE0pf8e3F LDAOB399STTPxd/avCCNJ8T4Xf6seW2Z4l/QvP03Ki3vyArSiisCSmKY X-Gm-Gg: AZFdTZdcyqlis1yVCPLXb8x5Br8QXKI2FNLDiVzxEatIxUkl3c1Ez44jonlVt4Wv40g QS/M0o+YkYipUtOJ9S4yTA5Cuvr/zUChvbnLDrklEEkLH2zWjyykKXvii+ZvlK8zpZB/ndJmQdS N+XpFmFMs8L3LUx3KuqL/ZUJk4VRSNpr7rRYeC74ek5JLQDbdseAkgev+4SrWYOnyKZBCGjbxRW Pv3394aN1SXDjE1Ak2P+kBRhE8O8oX0BwNLtgwxMHh/4GL+EW+aejZyoSsu0+zn3jRhYrBacuCk zMgdMtQ5xAlOceg5ySXBd48V31IbOM1+VkwrsR5KD/IYYWqqZx6VpPgezLcnW+M7mVyAF9xRgi9 eklyNLUSR+aCel3HTt7yjosL1yLB+Zk96XDLdyazVS/Lp5O7GxPM+rX/njj+++mBzTflM4hKXqI q4XPSX03Sff5cwCeb3qgoR8c1F0SFv2FfmNFj6CJSd+eNzlWpMXjcCyo5YnGe2A6Fd6x+mDYm4W MJn4FHw1dkQmS0IWOHLNICk/lVvPIKlkvqPB0oIYYFhQJDlcjJYeQCvfPztCaa294JzZpNIozIj QnnJMm/+1dw2UR2w8vYL6rG9xazjUGv0HcrBmMrxvlX20z1bk10x6VmR X-Received: by 2002:a05:693c:23ca:b0:386:a915:8b97 with SMTP id 5a478bee46e88-387521537c9mr4337450eec.27.1796459168142; Sat, 05 Dec 2026 00:26:08 -0800 (PST) Received: from jiayi-vm-sprl-server17.local ([155.69.195.24]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875224895asm16276500eec.27.2026.12.05.00.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 00:26:07 -0800 (PST) From: Jiayi Zhang To: Greg Kroah-Hartman Cc: Jiri Slaby , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Osama Abdelkader , Pimyn Girgis , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+0479f67e520e4910d370@syzkaller.appspotmail.com, syzbot+2430ce6b487fe0119d03@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] tty: n_tty: hold termios_rwsem in n_tty_lookahead_flow_ctrl() Date: Sat, 5 Dec 2026 08:25:57 +0000 Message-ID: <20261205082557.3074299-1-zhangjiayi1014@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120429-sharper-approval-9326@gregkh> References: <20261202180854.4154340-1-zhangjiayi1014@gmail.com> <2026120429-sharper-approval-9326@gregkh> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, Dec 04, 2026, Greg Kroah-Hartman wrote: > What changed to cause this to be needed now? Nothing changed. n_tty_lookahead_flow_ctrl() has read the termios and updated ldata->lookahead_count without termios_rwsem since the lookahead was added in 6bb6fa6908eb ("tty: Implement lookahead to process XON/XOFF timely"), in v6.0. syzbot's first reports of the two races are from August and September 2022. The reports in the Closes: tags are the 5th and the 10th with these titles. syzbot closed each earlier one as obsolete after it had not recurred for a while. > And why the "private" syzbot reports? Pimyn has explained how the moderation list works. The dashboard pages show that syzbot's AI triage marked both races as benign, so neither report was forwarded to the lists. I found them while going through open syzbot reports on the dashboard. For the hangup in the second report the benign rating is right: tty_ldisc_hangup() closes the ldisc after the flush, and n_tty_close() frees ldata. The other cases need backed-up input, because only then does the lookahead run, and a concurrent TCIFLUSH or TCSETS. After TCIFLUSH, a lost reset makes the receive path drop later START/STOP characters without stopping or starting the tty. A TCSETS that clears IXON during a lookahead pass can leave the tty stopped. I found these by reading the code and have not seen them happen. Sorry, I missed that Osama Abdelkader (Cc'd) sent the same change in February for an earlier report of the flush race: https://lore.kernel.org/all/20260211210838.45127-1-osama.abdelkader@gmail.com/ You replied then that it felt wrong and asked for a lot of testing and validation. My testing was the syzbot reproducer with KCSAN (described below the --- of my patch) and the same reproducer for 9 minutes on 5 VMs with lockdep enabled, which reported nothing. Since Osama's patch came first, please drop mine. If you want the change, please take his. Thanks, Jiayi