Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4609671pxj; Wed, 12 May 2021 09:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+J5Pia8lW2BFS1l4xQnu7/xDHRB6nVloWYp4iAwrqiNEMD6ITxMyoN6nFxH0BeTd5BTOe X-Received: by 2002:a9d:2c48:: with SMTP id f66mr23949478otb.48.1620835864809; Wed, 12 May 2021 09:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835864; cv=none; d=google.com; s=arc-20160816; b=RzB/7YRLF/4NjqJmwrCHG03U+qIEccovHUOs6VNP5Gya8zfFNTwa6h7RhtpaWFwPQt nuiuS+CrOW+1B/ftPx7KW8vHT9Vaus0cqE/iYLSBnZxicQCKGB2ep8NK8gbNGgPy1R6I fXLruHRdF2hJB6ExpfgihvAz7uig7PAnZBoGeFnZkdpPRBjhp8I2DcRo52efQ4XbhCTg gYgmJs7QJTpBbrkLKI2uNUrNN4OdRFSgLA61Cl6495O+dqI7BaVix8npi4jiGqEEj6oj i1UwcUqdAK0i8RUEen1FsOKJoU8s6ITktc5SvMdVY5zEC+dondC/Mz/zBs4kl52KpPWc 7I9w== 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=gncnts/c/N3RuNRorVM9GWt0QGdsp/Id0HbzBlP3r1E=; b=kfU1FK/nqisNlW9gPIMrB7lZbus5QcAl/ciqZOHscIhAsMMKYyLjY4i0ADrFWlFePc gqrM3JEoXURsHZlquV7ACVYHIICoqPPLsnue195PhNSx8l+iRun+3A2NeGIC+ap7Fs6C fMy27npkMG+jicPbJt5+2twIyejreJ3t+dMThiwZrSFNQx3wNOBqV/+w1jcib/7HAOtl G+Y74kTYoPl70hEQ6uDt80q9g7jvEidDo6FJwKB+4HdHx7c+efO1P6QBcZroWBDIO5Wo Fp/WnKCMDWL2t0AwSwYhghxXixWXdaQVpDJgUNyXAJ+0O7cycgd3D0gAMy8okN2ijIq1 rRUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xCrt4842; 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 m3si255448ote.193.2021.05.12.09.10.51; Wed, 12 May 2021 09:11:04 -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=xCrt4842; 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 S238899AbhELQGq (ORCPT + 99 others); Wed, 12 May 2021 12:06:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbhELP0G (ORCPT ); Wed, 12 May 2021 11:26:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C86E619EE; Wed, 12 May 2021 15:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832273; bh=E8NAsm444CS1PX3bfV1zlCkMeo/zNbsFaO2va+Kysok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xCrt48424wwknvTogbzMdX/xhUCpXE63n1q9zM3NL3gatsj4zAv58sCXbrXb3cv+E fjbxNVTcN/YB++oVrEsDCVHlmnuYHGkZyOC9wvsodNinsJJKI0pMMHzcijvGdOE5Zg JoEkDDVaS8rXJ5c7RqKpMq6FwpeIS0BZJpowLpu4= 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 211/530] staging: fwserial: fix TIOCSSERIAL implementation Date: Wed, 12 May 2021 16:45:21 +0200 Message-Id: <20210512144826.781072131@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 a7eaaa9d1032e68669bb479496087ba8fc155ab6 ] 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 fwserial implementation which was returning -EPERM also for a privileged user when trying to change certain unsupported parameters, and instead return success consistently. Fixes: 7355ba3445f2 ("staging: fwserial: Add TTY-over-Firewire serial driver") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210407102334.32361-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 440d11423812..2888b80a2c1a 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -1234,10 +1234,6 @@ static int set_serial_info(struct tty_struct *tty, struct fwtty_port *port = tty->driver_data; unsigned int cdelay; - if (ss->irq != 0 || ss->port != 0 || ss->custom_divisor != 0 || - ss->baud_base != 400000000) - return -EPERM; - cdelay = msecs_to_jiffies(ss->close_delay * 10); mutex_lock(&port->port.mutex); -- 2.30.2