Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp415648pxj; Thu, 20 May 2021 12:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEH9J6mNCDyki/qGkOczE235yU8UZV5PLdrZLmGwlNsv2hWAPehykF/A29hUVnfK1g2PVv X-Received: by 2002:aa7:d74a:: with SMTP id a10mr6401246eds.311.1621538255636; Thu, 20 May 2021 12:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621538255; cv=none; d=google.com; s=arc-20160816; b=qK+5pu+bXEV/mNl3hJohn9/3fJPKNMgB9WLyDc6SpqxTBFAtGmvk0CseGuAqhUI+iz ayphGptW+a/O/kMOB1eejzoS5SH8I41ntca/TzCOyMrx0DpCTA/y0myApiH/BoaTdFeN x8LJgtBZ78tguYNbWm9npOOIFKnU8bLVLJdpDuvwdxFPpQ2qxLKSXcIJyRrc8R9FAZXe 9DM4UXrNUi+iTbNVpwrKCB7aELkpx2f2y9qoradLzhYcRMOf9sRnC1Fjjiq9Frd4EOEn ONfKUgY1JpSGlEHhX+QDlpiYqfr7XaypH4tYKnfY2YvSBqedacPc3rNT3B1GdDRG0wYq JIhA== 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=9nHo4B255NieGcuAGlLcWOcLImtpvQU7MvLIKmuuXlY=; b=mKjpgLcQnhf9Vi8zZYloSapaG5mGoePn009nX/U5xhTzSuPIkSZ43CTNCbI7AVgCLb ALCsHD9xwBdI5/itx9mJWtkJ1s7Ko4V1IUxl67RBgCEDRbgCcULmQHO/uOwGixS4xcaD wiU7ysY6fT6TUX8NlGnrW4Vj35VILrp69HHgHYqxW8HVZfsYnIByeVFifQQNjZAgw2Ij JF0PR2BSkycHUzfZJHqymhoVulflh3KFqQTShcHsdEYLyyTXNCA79Bh7sSor1BoEJ1KH jsex4/MQQYNi6rDdzkmI3gbjLCHJHeV7vnpB90zBOx6xo9+UH0leuBjKKLqU0xO/pSga C/qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SRV4jplt; 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 v20si3110679ejq.133.2021.05.20.12.17.11; Thu, 20 May 2021 12:17:35 -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=SRV4jplt; 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 S237506AbhETKnf (ORCPT + 99 others); Thu, 20 May 2021 06:43:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236509AbhETK2i (ORCPT ); Thu, 20 May 2021 06:28:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E2DF61401; Thu, 20 May 2021 09:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504261; bh=T49rh45U6lPypUCiE91O/QscMUsu3C9juocM8XfqQ0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRV4jplt1XAesU4bPFShF3v3US0Zx3jiC2fcM6NRtgKfsAN3n/jlZrVId4ul2JaS4 TN+7TYKJNjLDoa53kTzUJR3xMsHI+MTb6k/zvKlADwnMblkqpWliLlTlh/ovCK6Hun TpOLconeUeEJiVr7RZFWo77LUeeL4+Z4M1H2MC2M= 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.14 164/323] staging: greybus: uart: fix unprivileged TIOCCSERIAL Date: Thu, 20 May 2021 11:20:56 +0200 Message-Id: <20210520092125.724807910@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 2b297df88bdd..b0b7d4a1cee4 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -657,8 +657,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