Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp196778lfo; Tue, 17 May 2022 22:06:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP5siP1hyLWD4kxMPCleXtQTHkUQ87XYU868f3bBpzxECXvdlpbVOSa0MNWoNltrIsCAwb X-Received: by 2002:a05:6a00:248d:b0:510:5d7d:18ab with SMTP id c13-20020a056a00248d00b005105d7d18abmr25837330pfv.51.1652850387418; Tue, 17 May 2022 22:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652850387; cv=none; d=google.com; s=arc-20160816; b=cAjoX51vgj9XA8cQ0joogQ2/HukecMBcT4r9UlGuYZwX9X3Jr6CLu/ALfgpjjrJdZR xPi076uTotzsJouytfYl3JCe1U7O3v3S8y/Cbo7KVK1vc3M7wQXDLLAIBz1/sHPMnRlJ kB8atrFjt5vP6ThBFWAGuO66V0mcuca7sdon4PtIq9Pf+xirHTqWP0EfAdgHXhsppGRR lew1FXXWnyAj1bWT3uWJvudytLJyNEBoswnqKo5ZxYKhCkZP8rIl29A2YIAz8wO82X8Y VoPfmkXtmZxVh5eonbVHJsqcnqEwyEIrF2du+9Fu1UnZK3DaUyDgWTfnxr4+U6RIEiNd Vltw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:subject:cc:to:from:user-agent :references:dkim-signature; bh=JhEIxejVecnbDWhDQcYeZEmlu9wzzw2sgbzRMYgpBdI=; b=zN7nub08blxtXGeUVAg0VxQtwzU5ncQwW2TFvPGkREF+TZMYr+5I++vieLgux8Kk6n NwXtSmw2fgsOyLkS5ep4SKnsos3RtYv4V7T1T0EEAC5pGZAXdmxdU6hszplviW5nvEwI /72kFnobJWwkdtGKhunQE84MLeQJcYG9z2M/Uz+yR+ork8WNJt14Ik3wJoYZAMx8vzNt xe0Mt34orSmExBllpyjPmWHc05QaSfskw/VU50tE6d34bTnaNct9rTwHrBX8zSNfdA2Y 5NHguBv0e4llIjpFk2ZR93nn+Ti3es1TEN4UQnzKQib4mxxsT552YvaEmD5Cir354HCR ux0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=bXuURY9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l9-20020a170903120900b0015c16a75912si1531455plh.552.2022.05.17.22.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 22:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=bXuURY9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F070B1D301; Tue, 17 May 2022 21:17:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbiERERX (ORCPT + 99 others); Wed, 18 May 2022 00:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbiERERQ (ORCPT ); Wed, 18 May 2022 00:17:16 -0400 Received: from mail.tkos.co.il (mail.tkos.co.il [84.110.109.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E2E02661; Tue, 17 May 2022 21:17:14 -0700 (PDT) Received: from tarshish (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tkos.co.il (Postfix) with ESMTPS id B5A474401D4; Wed, 18 May 2022 07:16:05 +0300 (IDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1652847365; bh=9RQ9Noiiv587Vg/jTUw5O1TnbrjqBwOFn7otp7MOCi0=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=bXuURY9a52Og3+pbv1jjY63EQxht7omaZJX8cTIQV252f47OGAtEA5CvXe1horI+X cmCcnrAWGGSdRTZ16c2XhjicBxxHIVRKFj+nBcVeJuNiLew3LVnGSGkczUbSmpfzqH t41Z+0LElO80K+bHOXB9xH2awU5qNodFcGXBHomw5AFW+De+MrZSydg9Vo1J3Z6nO1 LIP2ZzJvnIQL/t4CC5hq+M08hEcbS1ZDP/AUzbcjPigyFBPBS+HFLA0tiBNJqTVoGV CD1cLk0a8kv/li5/nHsZIo/xGb0d6rIC2EKWNMxg1IsQNmGAgZBzz1c/7OeJ54epVq TDCzLAvWEyu3g== References: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com> <20220517110737.37148-3-ilpo.jarvinen@linux.intel.com> User-agent: mu4e 1.6.10; emacs 27.1 From: Baruch Siach To: Ilpo =?utf-8?Q?J=C3=A4rvinen?= Cc: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/9] serial: digicolor-usart: Don't allow CS5-6 Date: Wed, 18 May 2022 07:16:01 +0300 In-reply-to: <20220517110737.37148-3-ilpo.jarvinen@linux.intel.com> Message-ID: <87tu9nqxtk.fsf@tarshish> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ilpo, On Tue, May 17 2022, Ilpo J=C3=A4rvinen wrote: > Only CS7 and CS8 seem supported but CSIZE is not sanitized to CS8 in > the default: block. > > 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: Baruch Siach > Fixes: 5930cb3511df (serial: driver for Conexant Digicolor USART) > Signed-off-by: Ilpo J=C3=A4rvinen Acked-by: Baruch Siach Thanks, baruch > --- > drivers/tty/serial/digicolor-usart.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/di= gicolor-usart.c > index 6d70fea76bb3..65e653eb5026 100644 > --- a/drivers/tty/serial/digicolor-usart.c > +++ b/drivers/tty/serial/digicolor-usart.c > @@ -309,6 +309,8 @@ static void digicolor_uart_set_termios(struct uart_po= rt *port, > case CS8: > default: > config |=3D UA_CONFIG_CHAR_LEN; > + termios->c_cflag &=3D ~CSIZE; > + termios->c_cflag |=3D CS8; > break; > } --=20 ~. .~ Tk Open Systems =3D}------------------------------------------------ooO--U--Ooo------------= {=3D - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -