Received: by 10.213.65.68 with SMTP id h4csp466796imn; Tue, 13 Mar 2018 09:58:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELvOM0HRWgcufbWgGaW5I+26zshSVe1H1L5Q6+k8i2YNOU8GG4Cx+5v1ITymwhdOdqF5Ewm3 X-Received: by 2002:a17:902:724b:: with SMTP id c11-v6mr1203326pll.352.1520960309919; Tue, 13 Mar 2018 09:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960309; cv=none; d=google.com; s=arc-20160816; b=P0DZSo/W+G8tYuu4eV7OHzZAnR8xikCLRWiZm2xhWzsbC9t9meuZvYgoRLrkQ7LTRh KW9JhWwtKQ3xoRg9+PdSZrIWUxC2o3m9JdLTJeGJOaf0A1wxIqviXE9BWKYpOqgvjVas au6NbcBf5cawCGWN6Phs7as7PDEGQslyRVOPrVMgoGoCMi5tzS8eQxP6ddWGVkWLDOkz 9D5v8BofbHH1fOd2+l6aIwTGtqSHajJLahfuQtJbuCLCqEZYqmOUCcst/dAUHhWAdBgY NMiajcPJjk0a87zh1jXc0JAnCBLXuJOwy2r4Jrh2X1h8mihNOAdKxlImbjEIrDeo4n9v i75g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MZzD9JURBWXZsEsLOOHfaKXZY18Dk+GnHoxbJC/jYl0=; b=smCJuckM4E4H2j9mGCrVEjbK5DeFJSSWvDjYO3Rb4iWn/JjjuFUrhfK5nWERSjID7N mVbujcY3fDQqdGsvrQl15P60+EAVXaAIspNwuhL59lI3poYTAYI8JcskJMco9gOw/ZGQ 9ziHYZ9gU8DywKbgjCm+mUB2VJ4irrorPpoR+5YRzgehx4/6QcmMbe6in+s//OCKsDPG 5maktjS2PX2cUVhU6qUuokb16fMVObeZ0dX3tCy2pWY2O+3aHoHy6ZYb5kdAY54DThvB Bywosxf9r5mE3IlccmI6UNMhIzeODKHip4KEa+Ld6+9jpTUkNz/IQZQmrwheO18t20Cc A3aQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h193si270088pgc.591.2018.03.13.09.58.15; Tue, 13 Mar 2018 09:58:29 -0700 (PDT) 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; 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 S933263AbeCMQzi (ORCPT + 99 others); Tue, 13 Mar 2018 12:55:38 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:42806 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbeCMQzg (ORCPT ); Tue, 13 Mar 2018 12:55:36 -0400 Received: by mail-wr0-f171.google.com with SMTP id s18so798234wrg.9 for ; Tue, 13 Mar 2018 09:55:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MZzD9JURBWXZsEsLOOHfaKXZY18Dk+GnHoxbJC/jYl0=; b=jE1e/Dd8LAoa6IKlneNetiD4MpZ3KC0P8Ekp2s8KPNn3msH60iKj0AEPqDIj5o5KkL P/SwrGTmDFqceB1CwXvT+yP+lyBBQhkZ6vZLRHVyhvrb9bpmStyaOsal3AwsU2ih/rkx z72T6NvojC+OW4WHaUo0f4GFR+SiOTbVHjy2Kosy9j2CXLv6w9gwCFF0CyyN/wGTGb1b uggyXL7qOYH24X2xUVNikMbcEsLIzqbV3cSVvFPClILZToKRbb5BevP2KnyYhRcuyLxj KrprqKXdbRaGNZ3yPi1hW5F6nEmI4+GFHJC6ubjed9zpv1h/d5i+CDiiZHTEqTYWCVhV 0Shg== X-Gm-Message-State: AElRT7HYjpYiKpAS0xOcS+GfdShLL6gmBG38g2XqG+b/0F5SMrAGUpYH XcUNuE1Q7u/atbP+VYKLi1E= X-Received: by 10.223.165.77 with SMTP id j13mr1190111wrb.220.1520960135404; Tue, 13 Mar 2018 09:55:35 -0700 (PDT) Received: from localhost.localdomain (u-087-c077.eap.uni-tuebingen.de. [134.2.87.77]) by smtp.gmail.com with ESMTPSA id r128sm378881wmf.37.2018.03.13.09.55.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 09:55:34 -0700 (PDT) From: Christian Brauner To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, ebiederm@xmission.com, torvalds@linux-foundation.org, gregkh@linuxfoundation.org Cc: containers@lists.linux-foundation.org, Christian Brauner Subject: [PATCH 0/4 v5 RESEND] devpts: handle bind-mounts correctly Date: Tue, 13 Mar 2018 17:55:23 +0100 Message-Id: <20180313165527.24038-1-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resending to CC grekh. Hey everyone, This is the fith iteration of this patch. Per-patch changes are summarized in the individual patches: ChangeLog v4->v5: * added non-functional patch to document devpts_mntget(). Reason for putting this in a separate patch is that it allows you, Linus and Eric, to simply drop it if judged useless. * reverse error handling logic to further simplify * dput() dentry in the non-function patch. This was not really a problem since the following patch included a fix for it. But better to get it right in all individual patches. * I did another rewrite of the problem analysis for posterity in the patch "Subject: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts" and in this cover letter. ChangeLog v3->v4: * small logical simplifications * add test that bind-mounts of /dev/pts/ptmx to locations that do not resolve to a valid slave pty path under the originating devpts mount fail ChangeLog v2->v3: * rewritten commit message to thoroughly analyse the problem for posterity in the patch "Subject: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts" and in this cover letter. * extended selftests to test for correct handling of /dev/pts/ptmx bind-mounts to /dev/ptmx and non-standard devpts mounts such as mount -t devpts devpts /mnt ChangeLog v1->v2: * see individual patches ChangeLog v0->v1: * see individual patches Christian Brauner (4): devpts: hoist out check for DEVPTS_SUPER_MAGIC devpts: resolve devpts bind-mounts devpts: comment devpts_mntget() selftests: add devpts selftests fs/devpts/inode.c | 66 +++-- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/filesystems/.gitignore | 1 + tools/testing/selftests/filesystems/Makefile | 2 +- tools/testing/selftests/filesystems/devpts_pts.c | 313 +++++++++++++++++++++++ 5 files changed, 363 insertions(+), 20 deletions(-) create mode 100644 tools/testing/selftests/filesystems/devpts_pts.c -- 2.15.1