Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4401304imu; Mon, 14 Jan 2019 22:30:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN7sjqsVbqflBn9Uxt+B0McSgbJTb3l3KbqqYXWPNx8A4L4HEi4u9cGVGkl7bv0zJ5LP+tYM X-Received: by 2002:a63:557:: with SMTP id 84mr2288997pgf.411.1547533809192; Mon, 14 Jan 2019 22:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547533809; cv=none; d=google.com; s=arc-20160816; b=YmpzSsQXXvhTHWG4POxwS5Arjx7v2fP+ql6dcHXfw72RkUGTxx9xeKJRx+k7kxeuBC IHfuKt5F0GZs/qMnPe4M0yNiphKyVJcrl8Tmy9cWCk5IhmkJLcyCcoCz73oxWnAw13EA x8FWH03/EQyGbyWDK7fhB7Kbm9Zh5vn9fCNC++0PuHbs/zilCJlfeqoYfJlpCc31ZY79 cI2Y1bZE8K5sINPXRlrWCRQBrqsa1Qw3GVClRzSdy1G39Rt/mXWkBgqw88MCT7mwydrl xZyeoWAPSoDqFL8iVtUqyKYrJPTPp5VZ+87l95KRqLPm1wTZwfkGpUi6CxmvHsJQzbuM 49LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:mime-version:dkim-signature; bh=uT5KAFMzctly29GQkRXTYCvUKUtrYWMIfYMelAjLtm8=; b=NI4BHubFWM1CfIZDlnf0k69NWMpZPXLAe862vTyT34ITFEpWF1FoEuiXftLFpsq5Cu BMgSd7G8YWtdAzm3KaJztU6E54zAqc6XOkU+rkq8GOGNT+//TM5/blyJIq9qewde4ghV f9NTbK/cz+lLLcscANCQ0mtt6RrZ/2KFcVa75CVhSMoCR0PoO2Eu1Vxq2Sfs2+RRvOS7 WQd0CaWUnPi2wqRLvDJdk0s2XU7k1XP3FrH3GIf4eyctJQrIev9vK4L/lGNvTWGKZ21p MWnDZzop33FkPmFJIR0gYadw2L9AoxBKDGcdZQKi6M6BvEuqaZ2wt4t8tlslkYpfFu6g +vMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ocallahan-org.20150623.gappssmtp.com header.s=20150623 header.b=vSMTyvRf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si2514550pfg.218.2019.01.14.22.29.53; Mon, 14 Jan 2019 22:30:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ocallahan-org.20150623.gappssmtp.com header.s=20150623 header.b=vSMTyvRf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbfAOF1P (ORCPT + 99 others); Tue, 15 Jan 2019 00:27:15 -0500 Received: from mail-lf1-f42.google.com ([209.85.167.42]:45356 "EHLO mail-lf1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbfAOF1P (ORCPT ); Tue, 15 Jan 2019 00:27:15 -0500 Received: by mail-lf1-f42.google.com with SMTP id b20so1025428lfa.12 for ; Mon, 14 Jan 2019 21:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ocallahan-org.20150623.gappssmtp.com; s=20150623; h=mime-version:reply-to:from:date:message-id:subject:to:cc; bh=uT5KAFMzctly29GQkRXTYCvUKUtrYWMIfYMelAjLtm8=; b=vSMTyvRfGIr0bapWBILhiZYGFidak3VX8PzWNQBl+Njjkuag2y78Y8DJ6VgRXYqv5p xm5XEz1xLwlxjtVKwjjnl8q2PcY2pvpPizL+fF9i3i9AW6tezS7h3l7+q0XEfcE1TazJ LxBjOh4jVg/FRXOFLLO/RmjQifqGsGNU+G+A7MTUjt6r0ruLHJIezmh/82AEj/qrbRg9 JkaYm3jNWFyakC1U5AXiHGsUWT2+8OR1t/qrkpE/0M3qHF2hW/59bTd5+RMWDSYABcz+ TqyipokcqL78NHxdii/Zz3vg7TAFrER4RVY1VljVRKbyTJBBGR4Bd7r1dh/UT9gkLIz7 vLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to:cc; bh=uT5KAFMzctly29GQkRXTYCvUKUtrYWMIfYMelAjLtm8=; b=H3i+4AyybhjhstCF9k+FIQS8e/V6q63Gc1kC4bywq3myyr44WKvZGgwGF614EM/N8g h8Sps7v3OGlcA8gua+yAKX0VFe8QXuX+I/zmxPYlPXhKojwLDqwy3zNETaoz/OWeCwPf T6ZAxQtEcVih0b1Xb4KJe4GDgZSC+e3iTTZVuVjMuwf742qgGgrug7A2qAqtyCCBMEpw OzNloTDcRrfzyBPa68LyuehiWbH4sGNVV5Zxny69JJm/gBWV/dTqo6hrE2bmVM38TPcj UoQ9l0tJo13sv3p6nssVUf9iELagOh1rPI7HB7YrCZ3qlrZwSzkcbOWe0GXlbfk/BFs2 ZMcg== X-Gm-Message-State: AJcUukeX/7Y2hkiUnpbJx7V9M7Ho7WxWi1IZyziosYoXnaLSSYbJJ4O6 Lw/yQ4E3h22VynsQAN9U4nIWRUOMqEEfZ/CTVq0qJDgA X-Received: by 2002:a19:df41:: with SMTP id q1mr1485770lfj.25.1547530032785; Mon, 14 Jan 2019 21:27:12 -0800 (PST) MIME-Version: 1.0 Reply-To: robert@ocallahan.org From: "Robert O'Callahan" Date: Tue, 15 Jan 2019 18:27:00 +1300 Message-ID: Subject: Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9 To: "Eric W. Biederman" Cc: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit refactored the implementation of TIOCGPTPEER, moving "case TIOCGPTPEER" from pty_unix98_ioctl() to tty_ioctl(). pty_unix98_ioctl() is called by pty_unix98_compat_ioctl(), so before the commit, TIOCGPTPEER worked for 32-bit userspace. Unfortunately tty_compat_ioctl() does not call tty_ioctl() so after the commit, TIOCGPTPEER from 32-bit userspace fails with ENOTTY. Testcase in https://bugzilla.kernel.org/show_bug.cgi?id=202271. I found this bug running the rr test suite. Rob -- Su ot deraeppa sah dna Rehtaf eht htiw saw hcihw, efil lanrete eht uoy ot mialcorp ew dna, ti ot yfitset dna ti nees evah ew; deraeppa efil eht. Efil fo Drow eht gninrecnoc mialcorp ew siht - dehcuot evah sdnah ruo dna ta dekool evah ew hcihw, seye ruo htiw nees evah ew hcihw, draeh evah ew hcihw, gninnigeb eht morf saw hcihw taht.