Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp315757pxj; Thu, 20 May 2021 09:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvI+/1BHTHzH3InZfBfy8jL5/RiuHp55+pny85aR+xBipUJroaTyc5OdylZ0Ur2uHYeApU X-Received: by 2002:a05:6602:1494:: with SMTP id a20mr1928281iow.100.1621529877551; Thu, 20 May 2021 09:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529877; cv=none; d=google.com; s=arc-20160816; b=FtbuuCr72gtndhWWRbhk7/rsFF/Zsi1eDgkJN1f8FEEgbuFuJOWOJm0KIy5ZCaf+Ba qb2eXn16SbmB5mxGo/xmRazguCzskrgWMBDThMcTxB7K6JEkUnugNjXh1IsXMWfCSXIO kntXf6En1tUWn+LqMj420VF67Y9R7eTY0kplkXlXsCPIRoTZz4fQ1Gfw361O3i1gZaDS SoJ3RSR1IGVi95PvpDsulbSmHcsHVGsLYjKrhQiLnGzF127uKprvSZrG4Akm4avJ1ark Uz6lQ1Cs2jv2EAlFsDIA03GptBAezokFnH6ALcKhb0nUMcNXdKCGhN7ZUzY4NBtLfoOI hZPg== 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=C4wtw/t2XObcBdFZk1mKM/GrXlwwOskfPIyC/htAnVY=; b=gL12I0jEFT8VdUY2CP08Dz2iyomCRUm5c/8ABko7n1nf5AzvnMabDvWzKjmZn1k+wk IjVCQLj6y2luyICDEqZKqsHVKpLiljhobV+gkRFb7eymDmnaia2OWanOP5ED6lzS0qNk pR3DlD6a3yf7EqL4WLDkCRfQCg3i1TPqmmoJ9gENAuLac1aeM6SVnA6n6mNDpMuI4L0p DPoCRgdI9YweEAQvQ3JluifEEAH8/R9hx8QCYv5WwL97Q6+eiN0zQvfMXqhn1qYJ25CT tP8TVR+s6TgpPxUeR7F5QP8QoPivWUjtgjDOo3CBtfQ4q4jh+gyZdIMepHYuFWkjlpgb qt1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAF3KkZP; 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 p31si3065810jac.95.2021.05.20.09.57.43; Thu, 20 May 2021 09:57:57 -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=FAF3KkZP; 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 S234386AbhETJ6c (ORCPT + 99 others); Thu, 20 May 2021 05:58:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:54308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234851AbhETJys (ORCPT ); Thu, 20 May 2021 05:54:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91CCF613E8; Thu, 20 May 2021 09:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503425; bh=8csTBPhZNYEwpZ/JDNZfQoTGZl82h2J9l4/jiCn7/4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAF3KkZPmWGMwvpr4UBthCf71Sa7apYmUrVjk6NmD+/JB17aA3AgjtdDT2USgBBMe vlBibNOJC0fSvvQJMlAnqw7/rlg8JruPg8QJH/t+DCIDhCdo3use4JQyY0J+lBaQWX BsxKh7Av+fpzJBL3tix02ybcgO/6lorXTAu3Lx6k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , Johan Hovold , Sasha Levin Subject: [PATCH 4.19 214/425] USB: cdc-acm: fix unprivileged TIOCCSERIAL Date: Thu, 20 May 2021 11:19:43 +0200 Message-Id: <20210520092138.456882105@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 dd5619582d60007139f0447382d2839f4f9e339b ] 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 cdc-acm implementation which instead indicated that the TIOCSSERIAL ioctl was not even implemented when a non-privileged user set the current values. Fixes: ba2d8ce9db0a ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)") Acked-by: Oliver Neukum Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210408131602.27956-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/class/cdc-acm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 7f4f21ba8efc..738de8c9c354 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -987,8 +987,6 @@ static int set_serial_info(struct acm *acm, if ((new_serial.close_delay != old_close_delay) || (new_serial.closing_wait != old_closing_wait)) retval = -EPERM; - else - retval = -EOPNOTSUPP; } else { acm->port.close_delay = close_delay; acm->port.closing_wait = closing_wait; -- 2.30.2