Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp313611pxj; Thu, 20 May 2021 09:54:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw3Q6wgBBCsLQfYkIe57DbR8KJPWkuVf6YXOF3LAsrIpEWhSCG/tlB2px2G5l0OHfRhdsy X-Received: by 2002:aa7:d491:: with SMTP id b17mr6197999edr.376.1621529679004; Thu, 20 May 2021 09:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529678; cv=none; d=google.com; s=arc-20160816; b=HuEf9ZeKs+c1WA9Tm1J5nx9ZDIF9Cb8sFa5tkc9QQDbNUvGGJC42tQgKwSTrNz13JM S41xw33e9HeT6OB378/5wuNuG10UFrtuct2wuqR/n+CXAZPsHY+4Rkat7tIf1it4jIxp u5u2hZ1I/1oBGzhHSUQk0BzNM2ZxMBWIFBCns9GciwaiKFfLVAM3gs4yULwjGQRQW64n 3KgVqUudix2lhUMO8c1lPu9MBK/fwmkl6jlfk6qRZIxBFo3+rWeK2kV8vnsH6TDZH3C8 BAI2kpH9lWl/2lV6NbFrmGcGs7+VoEfoMtunr1c0P9wjLPabHvqOhgZ4eIi2tY4T/aPC eTHw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0AZcxAClcCmFn7PqLpAtkF1IKPgEANYXM0nSkERkYSM=; b=zq1j12U0HONrMGMNNWB198psfJpUh6iH/o85WFyO/tfp28+PVEEueTsqALLGr0Ow9/ tRBlCBWF3RwDjvGR7uzHKSk5q7KlBkTWfPLpMa4eF34a4TZhtMQv8PrBZd2igHATJjh2 eZg3SrxMieuY/uunqW3abjuoKHwlb+TxGlgJTvhyS25d79O5KzDqVb/0zZAMbir74nNa Yjx3O6GK5/4ujKuL6W1Qzp7cqgI9WhQp/mDkygDW1/igALjYnPSNu71rlI4tbnsODraf d+6YwkVRq/xv2dE4koKJb7eMrLK6Lafl4kn76oMJiOA1kdhDdTbJXnNQ842+ShQEhpE0 6fAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="VKi/MNnG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si2487584edy.309.2021.05.20.09.54.14; Thu, 20 May 2021 09:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="VKi/MNnG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234417AbhETJ5A (ORCPT + 99 others); Thu, 20 May 2021 05:57:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:55098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbhETJxW (ORCPT ); Thu, 20 May 2021 05:53:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9820861406; Thu, 20 May 2021 09:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503392; bh=5MI6tBnUi8n5R9mIvil02HP/tmGopDwjJOSPEeu//7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VKi/MNnG7MXrNPuxjx+5gylZowsworlftYvErnpId0TO8FhL+0+q47Ycc+c42+wli kitSGHJImxPOlGFfulcIKX6xn2+Pa5urcsVPJKOlQDXIaAx/YStmrWB1gLJXnJc1NE FlXznMljtVG5lXgW19fl5XynBh41OaEC35PnyLs4= 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.19 200/425] staging: greybus: uart: fix unprivileged TIOCCSERIAL Date: Thu, 20 May 2021 11:19:29 +0200 Message-Id: <20210520092137.987915135@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold [ Upstream commit 60c6b305c11b5fd167ce5e2ce42f3a9098c388f0 ] TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. A non-privileged user has only ever been able to set the since long deprecated ASYNC_SPD flags and trying to change any other *supported* feature should result in -EPERM being returned. Setting the current values for any supported features should return success. Fix the greybus implementation which instead indicated that the TIOCSSERIAL ioctl was not even implemented when a non-privileged user set the current values. Fixes: e68453ed28c5 ("greybus: uart-gb: now builds, more framework added") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210407102334.32361-7-johan@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/greybus/uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index f36d470aed24..2343914f7548 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -656,8 +656,6 @@ static int set_serial_info(struct gb_tty *gb_tty, if ((close_delay != gb_tty->port.close_delay) || (closing_wait != gb_tty->port.closing_wait)) retval = -EPERM; - else - retval = -EOPNOTSUPP; } else { gb_tty->port.close_delay = close_delay; gb_tty->port.closing_wait = closing_wait; -- 2.30.2