Message ID | 20220517110737.37148-4-ilpo.jarvinen@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B510C433EF for <linux-arm-kernel@archiver.kernel.org>; Tue, 17 May 2022 11:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2Wdfs/Lohqvaqekf9FV1xUmAFBtFSATlf3l3O/Rv3dc=; b=SyfVXEuKFEgSOt 9RyEKj46c7LHnIjUYE8i+SD8nZRugdOOUvdjchz4FJCVPFKM4/LGw4ZyckGUlt9aQI6k9gOxvziRG tnPIOOqPZUAII+9t2NW0XRcyKrwUQctW1uN9MY5vicp040G5smZQnHmXn+42lkP1Lkb7y9kX5gk5X KG/vwzJNAd7dpb7GGsJBrMMSI/UgyiJvhIu6TZmf37cfsnoenmkzHX0oorXXEY+hYOgbeTF3mdBkW vbE0U16kvN6E3kNszV58DruxrbZNZqWPHKasIIeETlJOFyMx4V5JfG09WPd0Axh1+Twalv8xcu0Yv Xk8By5h4bBCpIim6LWFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqv3t-00DHWi-7S; Tue, 17 May 2022 11:08:21 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqv3f-00DHOD-0D; Tue, 17 May 2022 11:08:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652785686; x=1684321686; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3rLSxMemifcCya5x4k0dLXnkqmQGBK5a9aBX6E+21uY=; b=OuA5k01erH6lb9n805GCn8wgOYj7ucLzfjwDCqokDNe41gj7f3CuxJzW zbKgCWhtHYAwllOMgrWl6Q+cGFMBGYjMLbZM1pbLzcepgbhelGr3VppFb 44EHs5p386xBVdKCbXglrtPX1XgS56Oyd5ZloQFi7ESUXJuj3zpPgjYCS ukFsAAbPsDOgkzGoTH2VhFUaxDJXeujZOSas6dCNnjVG1tipjuz7WodI5 bbURJvxqDU9tsRssZH+c4QK8kgfLdnuFQvkmePs5YwUpjkvDrWoao/C7w IlIT8+oEnmtLG6Wd0o+KkBB675Zf5NGibEUZy1TZPShOOC1TMgImizcFO A==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="269969393" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="269969393" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 04:08:05 -0700 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="568830979" Received: from mtarral-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.52.88]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 04:08:01 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-serial@vger.kernel.org, Greg KH <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Manivannan Sadhasivam <mani@kernel.org>, Olof Johansson <olof@lixom.net>, =?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>, Arnd Bergmann <arnd@arndb.de>, linux-arm-kernel@lists.infradead.org, linux-unisoc@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH 3/9] serial: rda-uart: Don't allow CS5-6 Date: Tue, 17 May 2022 14:07:31 +0300 Message-Id: <20220517110737.37148-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com> References: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220517_040807_086965_93F8E987 X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
None
|
expand
|
diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c index e5f1fded423a..f556b4955f59 100644 --- a/drivers/tty/serial/rda-uart.c +++ b/drivers/tty/serial/rda-uart.c @@ -262,6 +262,8 @@ static void rda_uart_set_termios(struct uart_port *port, fallthrough; case CS7: ctrl &= ~RDA_UART_DBITS_8; + termios->c_cflag &= ~CSIZE; + termios->c_cflag |= CS7; break; default: ctrl |= RDA_UART_DBITS_8;
Only CS7 and CS8 are supported but CSIZE is not sanitized after fallthrough from CS5 or CS6 to CS7. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Cc: Manivannan Sadhasivam <mani@kernel.org> Fixes: c10b13325ced (tty: serial: Add RDA8810PL UART driver) Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- drivers/tty/serial/rda-uart.c | 2 ++ 1 file changed, 2 insertions(+)