Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp62516pxj; Thu, 20 May 2021 04:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXoe/VPhZ2hQt5qqg3sHqAiSjsKuVYEkz3P1QUbhvDGQdLX2QH/pFOtXDuRGjbkSl8jqCF X-Received: by 2002:a17:906:3385:: with SMTP id v5mr4195100eja.539.1621510673964; Thu, 20 May 2021 04:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510673; cv=none; d=google.com; s=arc-20160816; b=khdbJHDJ3nayRu7DE8Iah9BVZLHJGDvIDu6Vvjowkk1nfUmldzz8gvtZWaMAcRvmFT buam9FqelPBN1F8xSSOOxDEw8Xkmp9ULY9C5mrjDj183qRg3eFIFkUX2Kq239sm5b247 o/QVN5vV6l4SSjcJQxnzJIsFdRTTOZxId1+rNBXE3aXy4zxiF3J6dh80vlVaTOzlWovw yTjIQJ4oZxF6dSs8dGgfKqL6M0RrF4Q+DzAPQ0LxXsk2FWY9Q0rWOhHJYjs0k1VyzUNq jiT+V/rrQAAcamuuRxqNz+WvFlPUgV95aMM4qtkN+vgdoWa38Q/JL6o7ktT2NSPVZkyN gUuQ== 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=ZNrfwD9phPve4rcG6AdJ3EowtthtvTczJmOJ/FE/EnQ=; b=0/S6thFHVqPjlsC7ORAKPJ4+EgG12XAlOzoYA0yKwRpWOjHKijvMVMCE28X09z7aho Y/GWMBnnJI3te02jp0FXQFLNEGMTaCsIZNGajeAq82SazQEsyNFCTZ/mWLSzHXfzzKCL 7QTC3WwgOmt9r7DQXU5+eBFDxVVAVTHfelTSw3UNjQJ92oPKnyVeDMXrQnX07+Nt4w0X 20Ax/kxHNtWPj7lp5tBmrIToLcEaTrWKP+GFQplNlPerN5bvqs+AEHlUgxGO1Zp0Cv9o 40rErBSlF/zdWSLVXrpXG+gdGdVRlfLW8CR6HAOI5CJGuWIx1wCxktW6GdjIPehQ2Agf hKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N7s6wCCO; 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 v11si2493029eja.569.2021.05.20.04.37.30; Thu, 20 May 2021 04:37:53 -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=N7s6wCCO; 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 S239809AbhETLgC (ORCPT + 99 others); Thu, 20 May 2021 07:36:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239690AbhETLPm (ORCPT ); Thu, 20 May 2021 07:15:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B19361D5E; Thu, 20 May 2021 10:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505348; bh=9+pzrV+BAotpe9FgS0dlM/njhff3/8uV7rNJxVIBdxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7s6wCCOF+s8jMbl/9dKWr0YTYYr+PCDHiAzX7C4RqE0BB+Wm4LkIGbmj0D+q3m59 500mCbQnJBJ5NB6RD37U93Wrv4kIdlXO90E3auF2n0K564dkLoth3wfEE5yj9Pc/g6 QZFbctv5eSgvUtQTtwJARwVkLaT6/oskk0uwWNTk= 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.4 094/190] USB: cdc-acm: fix unprivileged TIOCCSERIAL Date: Thu, 20 May 2021 11:22:38 +0200 Message-Id: <20210520092105.310097831@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 8c476a785360..0478d55bd283 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -883,8 +883,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