Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbcDLBSf (ORCPT ); Mon, 11 Apr 2016 21:18:35 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:36565 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754597AbcDLBSd (ORCPT ); Mon, 11 Apr 2016 21:18:33 -0400 MIME-Version: 1.0 In-Reply-To: <61F170A6-5A56-4BF5-BFB5-FC62AB6F3612@zytor.com> References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> <87twjcorwg.fsf@x220.int.ebiederm.org> <20160409140909.42315e6d@lxorguk.ukuu.org.uk> <83FE8CD2-C0A2-4ADB-AEBD-8DD89AD4F88A@zytor.com> <87bn5ij0x1.fsf@x220.int.ebiederm.org> <78205895-E11D-417F-91DC-4BCA0B61A122@zytor.com> <877fg3emy7.fsf@x220.int.ebiederm.org> <87oa9fbsag.fsf@x220.int.ebiederm.org> <61F170A6-5A56-4BF5-BFB5-FC62AB6F3612@zytor.com> Date: Mon, 11 Apr 2016 18:18:32 -0700 X-Google-Sender-Auth: 2OFvHyHl6PrSNNvia1khyClxkh8 Message-ID: Subject: Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup From: Linus Torvalds To: "H. Peter Anvin" Cc: "Eric W. Biederman" , Andy Lutomirski , security@debian.org, "security@kernel.org" , Al Viro , "security@ubuntu.com >> security" , Peter Hurley , Serge Hallyn , Willy Tarreau , Aurelien Jarno , One Thousand Gnomes , Jann Horn , Greg KH , Linux Kernel Mailing List , Jiri Slaby , Florian Weimer Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1020 Lines: 25 On Mon, Apr 11, 2016 at 6:06 PM, H. Peter Anvin wrote: > > Why bother with an automount? You can look up ../ptmx from the devpts get_super method and just do the bind mount once. No fuss, no muss. What's wrong with that? Ehh. What if somebody wants to mount the same devpts in multiple places? So now you need to do the bind mount every time devpts is bindmounted? None of this makes sense. Let's just take Eric's patch, and strip out the permission check, and strip out the code that fakes a new path for it. That gets rid of 90% of devpts_path_ptmx(): all that remains is pretty much the "are we already in devpts" and the call to "path_pts()" thing. No update_file_path(), no inode_permissions, no fsi->ptmx_dentry games. Just get a reference to the "pts_fs_info", and it's all done. (Getting a ref on the pts_fs_info might require us to have a ref to the superblock, I didn't check that part. But rather than updating the file path, just save it off in the file data). Linus