Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp451878pxj; Thu, 20 May 2021 13:16:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziloOwwvT5LZFLhNxymgA6xTm5c2Rj+TGJtR7W7TmwLhhjw4UVpJ+ZbWOEHNmYWE0y12lu X-Received: by 2002:a02:9f96:: with SMTP id a22mr8886559jam.14.1621541761076; Thu, 20 May 2021 13:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621541761; cv=none; d=google.com; s=arc-20160816; b=BsZUFxVL4s+AthqmOh+KsAaq+MT8lAUYo/TeYdGliFA0m6kToeOQ7Hzown9rHUTg8Q yaiSjXbYIjfuM+qJ0k+cq36iCxGmyANuC88aH0i4zavWuH9yQN4+txuhycVLr7x6eAMX MXj3W0tVEHQPsXVtyktwbdUnL3QFlltCnVyuXW7ASCAiN/1FNIgpIWiUKSb/KqlNEmZg ycOe3IMAS6uhHVHNl+XyU6/gi5VdkI+33tggvp3OohXSuDR4N0zon6bL6fs2oA0AM+7O H55uYjqYZGD3umsNKpzITpSVIFu1IuTeC8yYvgyagbWLWG5bSizhxLi4xGl+UNBxqrxT ntnA== 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=gcx2NI57UtCMUu4zoa3WACcKNUmMtDX3/1IzUHdowT4=; b=aPwvWtWf1bhz3t8xxk/59sdYeAxCmX1yKJ0NpYcmF23NkoHgUTQJzHIH1/N/mrKV9K E4P65g+xqT8Dsffb4+feItmbpqO1/V6QoCoWhKHPeJqdl9TviEOhTsjiiRr00LOM7IC/ NBWJcoQ2bc8ahQVfnOY81bs2/nI6hut/1V3d6MYZyWIRyVFcJ/oD1poThci0nG053uSD AxUQS90ansVVIXBcnBwtSpBtOmxMtBrA5EF4IYKUqP5aj9Eesnc4a3Fynz/2vjsw8qsj NVuLEXNyDI5kd2VFS3DhJ05GV7Lw8bLo+kMwzyu8mGtcuJB/vh64vStW1eMVphtxe0+I 4Ggw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ienvgTBf; 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 x8si3487483ill.30.2021.05.20.13.15.48; Thu, 20 May 2021 13:16:01 -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=ienvgTBf; 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 S237537AbhETKsM (ORCPT + 99 others); Thu, 20 May 2021 06:48:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:60752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234377AbhETKbq (ORCPT ); Thu, 20 May 2021 06:31:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F80761C40; Thu, 20 May 2021 09:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504347; bh=ym+m/yQwNqgv38CotRp6lsOUloY4oq5yNC1CYHl0Vso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ienvgTBfSQbRy6o9gokC+R2GIh4O9NLrMmzO+mPAtMtLMOBRNwKrUoS4zOxXcYXGq YBxE1L9oGbcduy4+HZhNUINfKrxwdIgwBooS+of+lGHD09AuUc/LKY77paXNscMp5N UswSBqSWA2nO0IHM2mGAcuyFWTymglik1lTeWA0E= 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.14 171/323] USB: cdc-acm: fix unprivileged TIOCCSERIAL Date: Thu, 20 May 2021 11:21:03 +0200 Message-Id: <20210520092125.974336930@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 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 22a7f67e70e7..fbf7cb8d34e7 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -999,8 +999,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