Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp198625pxu; Fri, 4 Dec 2020 00:38:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAy2XCMWRg52DNdrJLsHWjpjsvIJ2H286XrxAkvv2gtLEg93yX4H5bP5nLU6vJUVG8AtAv X-Received: by 2002:a17:906:17d1:: with SMTP id u17mr6274388eje.229.1607071134266; Fri, 04 Dec 2020 00:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607071134; cv=none; d=google.com; s=arc-20160816; b=WUTLf9b+ioes7zlRfIti7cRLs600IS4F8eM5XDfB7z+aRycp/EZ3mPFlFO/CtQ26TX XFnIr8zTdtQqEDp/KKKQ+Tde9yscvf9THCnBc4NuqSnmcjw91lLm4h25UQGiqNElbDIp AzKHIcoFZqkXd/YpQevscq5J5RYu30lzll8J+s4sjrH4qpqwn27b+pQcl2Ec+Tm7pNA+ h8gxnoHrXzNMqab8T2RslKNUcpgUewU28pdaM2T1vux+I0fUwoIQLMdFleci6t1Nd8pW o1cDEsSXKrsJ6B1oFSrYgVnV/kVRJLzjMdul0RBqtlFWYj226yM80pBZCFJjfb1Cy/gF 3PXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=Q2zFQu4I+H4sB6Z4OaVuQYw3hwht3c5IP+5LoPIUC5Y=; b=AsndYcXQCUf5T34jmdiPpVLXPLRxEE8UVbX2SIJRYAKucj0DwzQSVHlUbolxgpxXtd h57CRfntvvaC5wnnEJvwhhwACHBKqCj9w9zUdbB+upYcLEyfO+ZYzHeG0ZLQnQTEmfbj Nx2aopK6Li5Bk9yybw1dN79AS+egVHe1Qp28iixSulNugxLeunPM+NLyLIL18KoTGeTR 4y9wCGbtKzhFOH05zoYZXTykKSHiTOF2w+1IiCCaFrkPRGf1TvUDicjidecIkXI/esWi tjEa7XE/HHlRXRV+Y4HiYZrvSDxTCj0E55PGt0uyep3MBnh1JjHteWpHaKppldtvv9EG XZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ftKTOAOd; 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 hp24si998682ejc.590.2020.12.04.00.38.30; Fri, 04 Dec 2020 00:38:54 -0800 (PST) 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=ftKTOAOd; 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 S1728004AbgLDIgf (ORCPT + 99 others); Fri, 4 Dec 2020 03:36:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:37328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727479AbgLDIgf (ORCPT ); Fri, 4 Dec 2020 03:36:35 -0500 Date: Fri, 4 Dec 2020 09:36:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1607070948; bh=xrXVeRA19rHpKc9qsMMpJxvtwCWgsBKzuPRdt9bWhr4=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=ftKTOAOd5E3OglR/1sPUwyQ7LkTfzKF3RoOZLWgyMnrvkNAJNMCT4m0TYzT5X02PC yJVPUUkZbflsPj6/jVceJODgKY9FoWuFFfzLxfSr0buI2uwZW/gdKPVWfS0mDBJFHB 5E8aNy1QSi0Y+tFCIfrwNad2M+iN+BXBZ2HA+f6Q= From: Greg Kroah-Hartman To: Jiri Slaby Cc: Jann Horn , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: Remove dead termiox code Message-ID: References: <20201203020331.2394754-1-jannh@google.com> <5cca5126-60ba-d123-0f7d-47fdbac4c4db@kernel.org> <93834a92-b342-aaee-c400-2883d5df0cdc@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93834a92-b342-aaee-c400-2883d5df0cdc@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 04, 2020 at 09:20:39AM +0100, Jiri Slaby wrote: > On 04. 12. 20, 9:17, Greg Kroah-Hartman wrote: > > On Fri, Dec 04, 2020 at 08:22:41AM +0100, Jiri Slaby wrote: > > > On 03. 12. 20, 3:03, Jann Horn wrote: > > > > set_termiox() and the TCGETX handler bail out with -EINVAL immediately > > > > if ->termiox is NULL, but there are no code paths that can set > > > > ->termiox to a non-NULL pointer; and no such code paths seem to have > > > > existed since the termiox mechanism was introduced back in > > > > commit 1d65b4a088de ("tty: Add termiox") in v2.6.28. > > > > Similarly, no driver actually implements .set_termiox; and it looks like > > > > no driver ever has. > > > > > > Nice! > > > > > > > Delete this dead code; but leave the definition of struct termiox in the > > > > UAPI headers intact. > > > > > > I am thinking -- can/should we mark the structure as deprecated so that > > > userspace stops using it eventually? > > > > If it doesn't do anything, how can userspace even use it today? :) > > Well, right. I am in favor to remove it, BUT: what if someone tries that > ioctl and bails out if EINVAL is returned. I mean: if they define a local > var of that struct type and pass it to the ioctl, we would break the build > by removing the struct completely. Even if the code didn't do anything > useful, it still could be built. So is this very potential breakage OK? I'm sorry, but I don't understand. This is a kernel-internal-only structure, right? If someone today tries to call these ioctls, they will get a -EINVAL error as no serial driver in the tree supports them. If we remove the structure (i.e. what this patch does), and someone makes an ioctl call, they will still get the same -EINVAL error they did before. So nothing has changed as far as userspace can tell. Now if they have an out-of-tree serial driver that does implement this call, then yes, they will have problems, but that's not our problem, that is theirs for not ever submitting their code. We don't support in-kernel apis with no in-kernel users. Or am I still confused? thanks, greg k-h