Received: by 10.192.165.148 with SMTP id m20csp4158052imm; Mon, 30 Apr 2018 12:53:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpm2OussG8DzPB56Z0wDRgKJMJHW9p/3Hr0anTnOND8LVfGAEZDuaZCXdKbzx42J5M+NOQ X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr13529628plf.77.1525117991531; Mon, 30 Apr 2018 12:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117991; cv=none; d=google.com; s=arc-20160816; b=kPtX/Q6svWNvPRmjN2pZHNJlmjymeEA+fGPqw484bGsNZdLw7Boet7GMHRPi7praIZ CamRrpVa0NXVaI92A56BUsaaXSL+INVJY3Q1mneFZcVaZFEuGHHee8hJEA/WUaLxZpGX Fm/iYSXRi4YUf/45B9qx9YUpicpeTy17lY7IhlaLNNYo8meIdUSN8YEzI5pP/GT8m0+R saZSuNTowD4WrXgS/RSvmEf7v4/RZz24Tjpb90YKR4qXiK6Aet/DQQqQTuyDgQlOD9fm 1DsolJEHIJ2RXHJVKvpdRg1GIQsmDnB2eLUq4/3SkEZ84NnDlO5xbCGLib7kg+ms1Yez ncow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=bBbNK0VlZjWRaH/asHvPqmCeQQk9AcY2qLugBA2H38Y=; b=HlTrobg5NqY5AFTRbmeriFJKWqEqibQUnqLpZEqdC1vHvPSGP2TF4jYjN4X8bzF6xq c0SFntRX5hPIWsx/gUhPpgJL+cj8Wk/1CLwqsQRv1ze9zoBk4GWiUxShKr6JiEIhMRFV WGKtPFCUBZg97jZ3vrcGAHWBpsE2hnudJQJ55n0/1UUq7RM3KxvCdEjRZYdihI7cjPvc St+Qi1D/Ns4kNQCjdjkOViv7c724XxmKhyPKfa+3LjVT9UNtEF3HvLQs1L8BvcZxa7qt GhJYbkPbK63YTAXyfDkdi2uO9tYsHLUSrqwZioILSaCaH4Osv+a5iAZwC0vD0L9/lBPV nfiw== 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 d65si8179925pfa.263.2018.04.30.12.52.57; Mon, 30 Apr 2018 12:53:11 -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 S1756137AbeD3T2D (ORCPT + 99 others); Mon, 30 Apr 2018 15:28:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:35170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755548AbeD3T17 (ORCPT ); Mon, 30 Apr 2018 15:27:59 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B3E022DBF; Mon, 30 Apr 2018 19:27:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3E022DBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier Subject: [PATCH 4.16 019/113] serial: mvebu-uart: Fix local flags handling on termios update Date: Mon, 30 Apr 2018 12:23:50 -0700 Message-Id: <20180430184015.892092940@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Zyngier commit 46c6975a1fd9794ed979565235d24b2f5004e014 upstream. Commit 68a0db1d7da2 reworked the baud rate selection, but also added a (not so) subtle change in the way the local flags (c_lflag in the termios structure) are handled, forcing the new flags to always be the same as the old ones. The reason for that particular change is both obscure and undocumented. It also completely breaks userspace. Something as trivial as getty is unusable: Debian GNU/Linux 9 sy-borg ttyMV0 sy-borg login: root root [timeout] Debian GNU/Linux 9 sy-borg ttyMV0 which is quite obvious in retrospect: getty cannot get in control of the echo mode, is stuck in canonical mode, and times out without ever seeing anything valid. It also begs the question of how this change was ever tested. The fix is pretty obvious: stop messing with c_lflag, and the world will be a happier place. Cc: stable@vger.kernel.org # 4.15+ Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -495,7 +495,6 @@ static void mvebu_uart_set_termios(struc termios->c_iflag |= old->c_iflag & ~(INPCK | IGNPAR); termios->c_cflag &= CREAD | CBAUD; termios->c_cflag |= old->c_cflag & ~(CREAD | CBAUD); - termios->c_lflag = old->c_lflag; } spin_unlock_irqrestore(&port->lock, flags);