Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2982207imu; Sun, 9 Dec 2018 14:14:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/WpGRzjP7+W2YKfq2UQ7uj71Y0fDhjbQHP0deTmmWu5BL9ZPjaDNFNd6rsTuyPg+npbf7aZ X-Received: by 2002:a62:7c47:: with SMTP id x68mr10181163pfc.209.1544393669981; Sun, 09 Dec 2018 14:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393669; cv=none; d=google.com; s=arc-20160816; b=Tpxv13p/eQU1IPotUSIayBgn7mGSR5rgzh8j2hZZZ8nX/xwl7esV6ZCey1n8RdRxCO 0JYH6sNivOqrEAFgEsgcu0ocx8eFzGCb62rZ8YfmIQKoBWFJr7TMTpkVJDPI+CKdxUI0 9TuGCcP6i9fsK6e2I/I/xXa0PX8jd4Ga4fZPwypCuxHSrXaEu4FqswVML9YGeU5Gzahx Ew+i1iFNXv4mcF9QDXgpbC+LXi2FtOv37Kgk/H3eOoLaeQdiVzspPE5xv1szhDEZUV0E KZ6bMKRXXafonyXyIlt5uOHTngjonKPLEmhv0sR/njAbDrhqU3R1sUSAvMuecUNOCtzP royQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Z2HKHi8Umm4k050ipY6NruWUgXV0A2kFP2NvYrXwtfM=; b=lxT0AOwS06oiOLGowrQA2sNaAN2uXaN6He7Yt8LntZKmQ8lE2xYRnzZYZXOvRhmB+f A/ftAt6pAi74OW8jjOKf1xGPCsyQ14c92GLNSOK0eNKm41bySz3T3/TmNFVimISmKW06 SVBfq7D67Neaxad/3wEEQXxGSHK2yi47SJ1KEJxamGFcvu4oOb7ITJk6Zt8pL0O7amsR MkBGk81SgiThbcVMwSBnK8Y6ODLX2JFKyGMdOERc8bHv+Zo3FYNgN00gDEPvKN6aIIkc u8pqgPjyx2Rfh+3eqGzbMMLyZK88SRZXSNyy1hjFf0mGVrelDDRVVlOUIdu3E8/UV7eW 7njQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si8316621pgd.256.2018.12.09.14.14.14; Sun, 09 Dec 2018 14:14:29 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbeLIWM7 (ORCPT + 99 others); Sun, 9 Dec 2018 17:12:59 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37842 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbeLIWM5 (ORCPT ); Sun, 9 Dec 2018 17:12:57 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73R-0002ir-2l; Sun, 09 Dec 2018 21:56:01 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72Z-0003FE-CW; Sun, 09 Dec 2018 21:55:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kroah-Hartman" , "Johan Hovold" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 039/328] tty: fix termios input-speed encoding In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit fada18c48d774b9e837928ecdce6a5d5fdd11ee7 upstream. Make sure to clear the CIBAUD bits before OR-ing the new mask when encoding the termios input baud rate. This could otherwise lead to an incorrect input rate being reported back and incidentally set on subsequent termios updates. Fixes: edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/tty/tty_ioctl.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -419,6 +419,9 @@ void tty_termios_encode_baud_rate(struct ibinput = 1; /* An input speed was specified */ #endif termios->c_cflag &= ~CBAUD; +#ifdef IBSHIFT + termios->c_cflag &= ~(CBAUD << IBSHIFT); +#endif /* * Our goal is to find a close match to the standard baud rate