Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp206000pxu; Fri, 4 Dec 2020 00:55:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxx66Lwtj1XMrQeeHUWaMT5SHgePC58j2onZAEHvVweW9PZ5POjDDL7nOl2+c1Zu0TltKZh X-Received: by 2002:a17:906:770d:: with SMTP id q13mr5907176ejm.409.1607072110329; Fri, 04 Dec 2020 00:55:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607072110; cv=none; d=google.com; s=arc-20160816; b=uFTjPc2z/SVaSSvDVJ4Qk3YzhRDMOnYYno4X3Q6ndKqizVLpM63O6BfW1s+MXQO6/g 7fTGnHo6j/jjMkxAw4xyFp/qAWUA20WR1ITCo02tF/eEnkKJGu8kX0yANSYIj2/sK0iF D6TSUX0Tk/vcyeHN7iZgwqMnaUb+RcZ4nFk2Ce9pEHIhIfj2Sj09kRkCpbeoTc4w/rWe UjL/P1zgh9F5pfriLlExTzlPIj2PyYpMHRAc6iH5kI/qpWaHXkM8tdrE8iMQEuoQREot 8VOQz+qDjaFn3AKGmq/rytCWcplCxqA2YBNnPZD403SH3lnsVJF1eLyy26s1Tpr++lOT a2Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=+GwkYozyuYkSJzQ66Wy4YG7jbCUKS/kTrRERj/Igh/g=; b=F1HuVT4E05Sm7IY6/3No2AdvioywFY7kdMU6lxWnRoz0r9+IHREwbkgmINuLG6+uBP n7VzEfys4QxIBBHhuvgnz3/w1QyaWeOJZALRxaZYe97sTLowl4+iuMCZVAFKO13BV8WX N7gXsHBfjJtFrBcC0hUuzkC/rvOa6Vd/Eb2T2AKovANI3uxuk/fXa+2UxYwsH7B3M/m3 eDTQS1zdNX4ny7zhUekjVGqdjrKKiYITKN9gcODlnuZQL5xj/+I8anYj9erJ3f9HLi0O GD5fd9xy4QINagAg1KCyu1gh0shi5ysQMXsZR5ZdLlJR59ZLsoAij5EsCVXgMyQImnmM ktEQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l34si2340420ede.416.2020.12.04.00.54.47; Fri, 04 Dec 2020 00:55:10 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729290AbgLDIvv (ORCPT + 99 others); Fri, 4 Dec 2020 03:51:51 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:34025 "EHLO mail-ej1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387496AbgLDIvu (ORCPT ); Fri, 4 Dec 2020 03:51:50 -0500 Received: by mail-ej1-f65.google.com with SMTP id g20so7579351ejb.1 for ; Fri, 04 Dec 2020 00:51:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+GwkYozyuYkSJzQ66Wy4YG7jbCUKS/kTrRERj/Igh/g=; b=nG72YHbWxZ9NZkX6QLu2bsshGSCnBHJ2ByJhxseOrb33DyA0W68YrvYa67OATTNW6S mkYW3w2XW+JjSD/7hxG95WGoOPdA3sBV9681kuhdge4IGBD77syDOc9CCXFwB3F5KA80 smigX5JuM33a8k/HdxTtf4fFYlhLfQhjQEZmyOAI6Uj1FxfnpSROqMGBLVdndVqTtgC+ DbGY8CJHysUFve3gttco0WtrEWFMyGO4kCw7GBOPcIVJCDIx8kgOPzq9GuCzpxjOo7ZG J71YaZS5URXUotcBfeujQnTbW1afZEUgGJSbwPyOwHPUmvvjsxSsYuBFOp0OQfbF9SL6 nZhg== X-Gm-Message-State: AOAM533yabXYDEUZuMn26rvjNo0chkLZHT3DtgmSZERHRTtAwiSNl42w i0/K51qOnUALDokEktIzcOf4fCnSsp/MbA== X-Received: by 2002:a17:906:2932:: with SMTP id v18mr6061514ejd.144.1607071869141; Fri, 04 Dec 2020 00:51:09 -0800 (PST) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id x16sm2592942ejo.104.2020.12.04.00.51.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2020 00:51:08 -0800 (PST) Subject: Re: [PATCH] tty: Remove dead termiox code To: Greg Kroah-Hartman Cc: Jann Horn , linux-kernel@vger.kernel.org References: <20201203020331.2394754-1-jannh@google.com> <5cca5126-60ba-d123-0f7d-47fdbac4c4db@kernel.org> <93834a92-b342-aaee-c400-2883d5df0cdc@kernel.org> From: Jiri Slaby Message-ID: <8e993706-46e2-cbed-265f-1ba63cc9274d@kernel.org> Date: Fri, 4 Dec 2020 09:51:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04. 12. 20, 9:36, Greg Kroah-Hartman wrote: > 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. Note this ^^^^^. He is talking about _not_ touching the definition in the UAPI header. Does the rest below makes more sense now? >>>> 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 > -- js