Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1393125imm; Sun, 15 Jul 2018 06:44:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeq6ezANIF9M3LQqs7was0kboQRG0eNdAHKv0Yrzkz4ySz2cU7tA9lPpHpE/Rg8O7XqcxBl X-Received: by 2002:a63:6441:: with SMTP id y62-v6mr12239038pgb.240.1531662266981; Sun, 15 Jul 2018 06:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531662266; cv=none; d=google.com; s=arc-20160816; b=06mQgp/HXInVpVfPn3jkvn4wS5T3de4C513rqvXw9bxarHWfTBb5l6cyPZcIe/r498 G/QgjoVnZEskTb9L/AunVsCxRNRtTkhkr5zLUCGobiomMqbQ+4c2xKFVJ16t/knasDEl QBZsWC6jmwdZrSCVZg0oDd6ewR7bljSoy4BRHR8TjMjsVbwDZn+tix1APYn8gNI9FKAo jci9Q2OnPEvcDB3ukrz0IFPZYw3s0/yWifgJ41T7d7Rphedd6IV06WAzEY3D5ZudG71c PcvnVm0C/Zx2GQ/idvCI9kPVL/5foteNStniEH/5G6VhJW/plekFXJdKKITOG36QDNHn kD5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=B6OCQVNoKL3ERM72KMQHUkADhQugADJSrE6aOjnHvAs=; b=OxIo0ckpd5iprnITixBN2qACUCHhxH7DI492Fn2iJpUwFAjg/yWrxmXwQQ+YmI1dkO PU9Q+mKufU1NAsxk/Kj7zprJEZNnzcfq7+JkmTPfrG4XW3/lgw0NCtRLIL67iOBqy94X sVjluzJGuu42qTDhIcTS+024+4v3mQCPJ43mQzX1u/FqCcXsedve733i0lSTpDSmT/Fq pyqJw0RfMpDOjSAQfap6wrUzcktjovdgTqdhQIRem6/72+BW/iMCBEKgvBb6rKFxt5Db /mRJEG0/3KmlPUkaPEHZezPThzEeGvDbbFpO0heMRfKzLZ1zsCnRwsnw5pwtqjUjywof 0kEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VojxLPD5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4-v6si24840385pgm.454.2018.07.15.06.44.12; Sun, 15 Jul 2018 06:44:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VojxLPD5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbeGOOEm (ORCPT + 99 others); Sun, 15 Jul 2018 10:04:42 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35460 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbeGOOEl (ORCPT ); Sun, 15 Jul 2018 10:04:41 -0400 Received: by mail-lf0-f65.google.com with SMTP id f18-v6so14289620lfc.2 for ; Sun, 15 Jul 2018 06:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=B6OCQVNoKL3ERM72KMQHUkADhQugADJSrE6aOjnHvAs=; b=VojxLPD5Y27iGgR0rMM7imggva2RpLe8MEmIe4E1r0DN39f+9+armqGVo6uWVBO83U pDZJfzfry/Q+ZVNUcfthpGductafvAHIDo9az50RvyPvLk+FlSYJQTErD7QllfyENXEE Y2CAJXu+xIg1YnfiqS5lw/niz7A5JfMhjiFhm5AaE2J2viNuk2kQeY/Ty1C3UG8h8hSt 7V8swjx+BO9bMilkpIV2KRa9oyd6Y8pYLftHQV1HcNoh4rzsVQq9b6NQCXB4fP1HB1ye wcsHfGyrqq7HPYqDV2PC2F2+AcQzYRrrQixNfto+LdvcXKxlyIKy99nfZdzUeo130oNP TbWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=B6OCQVNoKL3ERM72KMQHUkADhQugADJSrE6aOjnHvAs=; b=toyAvosdsxzvyNzoZg99JNFHodMwt3H3WjpgYVvaFgv4dDtu8zTM3Nnaf5af/w6O9y nXX7A644Z1D4kaBv0y2nrNoVr/dzgmUlaxFlvUVpBVftdcZ/Pv/95wmVzyji76is5+d2 yufPCsBD7PDzNeohYfeaSDELQfnOC0M8Ke4k6SNGnusEf4pyXepa8gBFe3/Hat16sADP NCNdakjvQOSNs8AuK4+sMkXONG+mYHU/m5tMRQdoxQzJkLYrQY4YiIHnB6RCodsIRIyU RCvHAofFJuvVXpmcxSQDfx50N9hfDizvg7UPesl8lef4eqYJQAkFhMkoPJSOpcG+O4JA Lhig== X-Gm-Message-State: AOUpUlF53m5JIXghShK2oESRPI3xZbkvfLDIwY3qbA/VGcb2jLbHJrFW 0fNvr2kmRXsBiOeQeGJ2DYs= X-Received: by 2002:a19:d54c:: with SMTP id m73-v6mr9156416lfg.27.1531662100098; Sun, 15 Jul 2018 06:41:40 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id w12-v6sm3868448lji.63.2018.07.15.06.41.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jul 2018 06:41:39 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fehHI-0006WH-QT; Sun, 15 Jul 2018 15:41:32 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , Alan Cox , linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 0/3] tty: fix input-speed handling Date: Sun, 15 Jul 2018 15:39:32 +0200 Message-Id: <20180715133935.24964-1-johan@kernel.org> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Turns out we had some long-standing bugs in how we handle termios input speeds. Specifically, we could end up setting the CIBAUD bits despite the user leaving them cleared (i.e. B0, which means that we use the same input and output rate). And once any of these bits were set we failed to clear them on later updates, leading to incorrect rates being reported back to user space. Both issues could lead to an unexpected input rate being set on subsequent termios updates unless the user actively clears CIBAUD. Fortunately, no in-tree tty driver seems to use the input speed for anything but to suppress line-setting updates, so the impact of this should be mostly limited to the CIBAUD bits sometimes being incorrectly set in returned termios data. The final patch cleans up the conditional compilation of the BOTHER and CIBAUD functionality by not having the latter depend on the former. Johan Johan Hovold (3): tty: fix termios input-speed encoding tty: fix termios input-speed encoding when using BOTHER tty: support CIBAUD without BOTHER drivers/tty/tty_baudrate.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- 2.18.0