From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE8CEC433ED for ; Wed, 7 Apr 2021 10:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A34446139C for ; Wed, 7 Apr 2021 10:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350968AbhDGKYH (ORCPT ); Wed, 7 Apr 2021 06:24:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:44624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234751AbhDGKYA (ORCPT ); Wed, 7 Apr 2021 06:24:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4EC00613A9; Wed, 7 Apr 2021 10:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617791030; bh=34TodTLk/VIckWwu+MXMhXACn6D2SHx7dl/QxJWtCh4=; h=From:To:Cc:Subject:Date:From; b=j3aUX0a2jRPk8uuSvr0bQAHZxKj43BMUM1/GCPNzXg9gD6wLgCVFByb5/A3oiBlsP YDuKh7eUXwAuZ6Gbu9U6YqadfasICaTsuDx89OtcH5tA2Hh/1xVWv3LOBfATGJomLJ v1iy3J3AnHaFO3ogEzmGvH19l8XXCPA5E1lrIoPyN7Oinl9wZxXOU7z3HUieBgO2SV RYr4p3QALLm1TRcb8whe8jHFW0kIny7SnPJlPB8bQsMdVNuN+xHrFqL8b030ja7DQ7 HJnc1n2zWZLQEr+80x38NcnTRkmR6zEFQ0mLqmtcGqp5dWrPeUEZwgHKI8EhYAd/n1 k0T3huxrFE74Q== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lU5La-0008Qz-Il; Wed, 07 Apr 2021 12:23:42 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-staging@lists.linux.dev, greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 00/16] tty: TIOCSSERIAL fixes and clean ups Date: Wed, 7 Apr 2021 12:23:18 +0200 Message-Id: <20210407102334.32361-1-johan@kernel.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. This series fixes up the various ways in which driver authors have gotten the implementation wrong over the years, like, for example, jiffies conversions, permissions checks and error handling. The de-facto standard for error handling is to ignore any unsupported features and immutable parameters (cf. UPF_FIXED_PORT and deprecated ASYNC flags). Permission checking should prevent an unprivileged user from changing anything but the ASYNC_USR flags (and custom divisor) by returning -EPERM. These patches are against tty-next, but the staging ones could otherwise go through either tree. I'll be sending the corresponding USB fixes separately. Johan Johan Hovold (16): staging: fwserial: fix TIOCSSERIAL jiffies conversions staging: fwserial: fix TIOCSSERIAL permission check staging: fwserial: fix TIOCSSERIAL implementation staging: fwserial: fix TIOCGSERIAL implementation staging: greybus: uart: fix TIOCSSERIAL jiffies conversions staging: greybus: uart: fix unprivileged TIOCCSERIAL staging: greybus: uart: clean up TIOCGSERIAL tty: amiserial: fix TIOCSSERIAL permission check tty: amiserial: add missing TIOCSSERIAL jiffies conversions tty: moxa: fix TIOCSSERIAL jiffies conversions tty: moxa: fix TIOCSSERIAL permission check tty: moxa: fix TIOCSSERIAL implementation tty: mxser: fix TIOCSSERIAL jiffies conversions tty: mxser: fix TIOCSSERIAL permission check pcmcia: synclink_cs: drop redundant tty-port initialisation tty: synclink_gt: drop redundant tty-port initialisation drivers/char/pcmcia/synclink_cs.c | 2 -- drivers/staging/fwserial/fwserial.c | 19 +++++++++--------- drivers/staging/greybus/uart.c | 16 +++++++-------- drivers/tty/amiserial.c | 25 +++++++++++++++++------ drivers/tty/moxa.c | 21 +++++++++---------- drivers/tty/mxser.c | 31 ++++++++++++++++++++--------- drivers/tty/synclink_gt.c | 2 -- 7 files changed, 68 insertions(+), 48 deletions(-) -- 2.26.3