Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2512930imm; Mon, 24 Sep 2018 05:44:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV63csnupVrwN3PTEkjuNqCBF1kf88pE2+yJUQrU5T0cyvJzlNe7wGfhsTduMouN+fMcXHA/w X-Received: by 2002:a17:902:292b:: with SMTP id g40-v6mr10442150plb.223.1537793048624; Mon, 24 Sep 2018 05:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793048; cv=none; d=google.com; s=arc-20160816; b=rO8TG7UNxz6ZDw/vwdYTUSSFmjpkHL+tDNb6i/gRNXI8Iz5hn31CZLp5g2+1OdlaYQ hPuLveFeYuWRRKT49oHUET8cDQanoAj8LyKNWgvKq8AYjsf1b+fi/Kk2yBbqWF7KKWh1 fokqGYOPMYWlO4TEZ6HwMDcEhRgHXZTyYcXZ67C9QdHUuJJ7+nxDF/FWaENe0oao55GL lZg6TVRrsF55q0CW+LGPIIMZPAG/ex9CerfY+2XJN2tnO5yJZoL96c1S+yNTulwK3TgZ zxKb7Hijivxgt75xf79c0u8EGgrKzVK2aiXhNtuTeq5ssvBMCUJopl6Yvo3pc0pPE08a 1U/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=zQsnKyvryllKZXdNcrJh3pZkLNgWkjOk18m3oIE4LTs=; b=UbqGlJbc8NMJFfJwH2rbL+ZxShQ2sJe5YtCknNozAbXK64igx+MhVvDVeKNB9YOu9k /jZEMX1Nj7fvAD9OyCB8nVEMLTCxVSiwmHkrt5h37DgbAeBMKcB1YjzxOt5zE4RtffsZ B/GwEOFzWN8IKl4fK4IaUU2xaQWcpuqs6YGJewRaU/1sNQf6fOcusSvthJgSNKUrfhYq aIR9rhzYUNhbpNIt2qB9Z4/wXPYcAJj9IwWOz3rCuQx7owojUhgtwmOxN0DArMfvYQue pNxRWfJ3P6URgzEZz3Lj7M++2OyAVLHYIebC1EBgYgm0PVk9KPWiTLVqyXZ6RuoEsqXN BHvw== 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 m7-v6si17338443pls.194.2018.09.24.05.43.52; Mon, 24 Sep 2018 05:44:08 -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; 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 S2388822AbeIXSnl (ORCPT + 99 others); Mon, 24 Sep 2018 14:43:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59182 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729543AbeIXSnk (ORCPT ); Mon, 24 Sep 2018 14:43:40 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 21099109E; Mon, 24 Sep 2018 12:41:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Sasha Levin Subject: [PATCH 4.18 180/235] tty: fix termios input-speed encoding Date: Mon, 24 Sep 2018 13:52:46 +0200 Message-Id: <20180924113122.656265794@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit fada18c48d774b9e837928ecdce6a5d5fdd11ee7 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_baudrate.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c @@ -173,6 +173,9 @@ void tty_termios_encode_baud_rate(struct iclose = 0; #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