Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4600746pxj; Wed, 12 May 2021 09:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF2ZZ4g7OoofckThI0lEiW9OzSEVug4DteXGP+l0J/rSLfTyIoo0XxfT/rfxMYt6vvbqhy X-Received: by 2002:a17:906:bc8e:: with SMTP id lv14mr38284689ejb.418.1620835298920; Wed, 12 May 2021 09:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835298; cv=none; d=google.com; s=arc-20160816; b=flmAFaw0CGcxAQygiyLpN7SRlaPdLfM+ylCaynIayePBjg81MqMfRDg/D8oT/QoQ/m 3ON1atoPwaLEbmQqZZHDtryC8gJtTfehUwKyEyWx25kNY9xFRBSIMyskTQ8JN7kTKQgz tL/MG2ian5eviOe2v1g9a50aqij86smeiCkLKGYcYV3nsGWuLnRktupYUi5/A5CSaS06 TuukXEYh8fJ0abkIXbMobkduRVND8NNP8f+lEcdXkOKXwEq0S8KOlEzEdsQ3eJ6Z31M7 TfQIebAFPCbq6AKpAXXKpYQKg6FFY0XYrAQPHoXJZizYUnp3mnC2eHgbWc0IM/W2ijP9 bTFA== 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=m1TlJWEFnoIwbjOJncpUmrzYZjuEWrM1s1FAZgeMWqQ=; b=t63v0lsQ2lcGs04LMmLbuNZEai4E+ge9UYDsEmMAL4SN+8wCANOC+kaUqnx8l1be03 WgFJVRdTh0m+Zs3Qx56GajVrMCQV+b/j/i8zWQeIwYAMT+2XPn2LW1czHivggSyOqg7+ o253m/7SufgPfaOeCVtfINeuk/HgLAUH5RwsnN0Q/3QZuD2gWuThkc7vjZUq4+tEv8Cj iA2yBNT2I+JM5W0l6TZLIdCh+5/tiBNpew+PxbYNl8LYtsptjp8rIe6dkqaGfVjL47l+ R0qKgqPbjIsNnX37bOm5gmnQh9X9f8YxcjFcTd+kSLrMg2IhXlo3PAIiMG5+NACIbsmv 7+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rsmVYMtn; 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 m3si102499edc.293.2021.05.12.09.01.13; Wed, 12 May 2021 09:01: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=rsmVYMtn; 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 S235819AbhELPyz (ORCPT + 99 others); Wed, 12 May 2021 11:54:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:40396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235036AbhELP0Z (ORCPT ); Wed, 12 May 2021 11:26:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5055061982; Wed, 12 May 2021 15:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832278; bh=L6FZUSPrXFNc2fmHnnmd9k6ISPJpUBmPxwvwj90l3pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rsmVYMtnzV0Fc8R0lLKqxvo3Cy1vZT3MxeMu9LWhprjh0fZErAuEUeU7NQw6+gD/T qGH9JLDNcHffsTWyiPPyd5MAnn9xNu6rll/CPmypiaQLj/ivj8Xbf/K1DcqEVfNr8x H2V5lPdKoQTPxXxFuplQqnkTfIpLZsP3Q8pyfZ5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Sasha Levin Subject: [PATCH 5.10 213/530] staging: greybus: uart: fix unprivileged TIOCCSERIAL Date: Wed, 12 May 2021 16:45:23 +0200 Message-Id: <20210512144826.844542228@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 29846dc1e1bf..a520f7f213db 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -641,8 +641,6 @@ static int set_serial_info(struct tty_struct *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