From patchwork Wed Sep 13 15:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 13383305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AF15EDEC71 for ; Wed, 13 Sep 2023 15:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241245AbjIMPXn (ORCPT ); Wed, 13 Sep 2023 11:23:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238441AbjIMPXk (ORCPT ); Wed, 13 Sep 2023 11:23:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C73F1BF6 for ; Wed, 13 Sep 2023 08:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694618564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fibNFcMGfhpyzyB1Dlmhk6FIYISVfSif6JjtonTL8MA=; b=SOkpT1pAJioV8vwayhi6YzbU+r5oVA28EKhheRrPcqPvi+2mILhqHedt3RWFMl780VkocI i3pO9DySWebawOJTk/er/mjeuc1iA20iwyeADkKoZuyI0zgqCJRsHl9NRnlXnEQ0v5TCgX OjY86sN23Hp0x+WhhAfTuMe//42Ptc0= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-_7RKnktRMOuonUhBjFQEcg-1; Wed, 13 Sep 2023 11:22:42 -0400 X-MC-Unique: _7RKnktRMOuonUhBjFQEcg-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-94a355c9028so457336166b.3 for ; Wed, 13 Sep 2023 08:22:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694618561; x=1695223361; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fibNFcMGfhpyzyB1Dlmhk6FIYISVfSif6JjtonTL8MA=; b=QRh2ficWtbNq3/Iw8pWQR+OCys7TQC92UvEMFt+NwmhS1bM6M9Kau5GoTl4gQh6G5b yqCpqH7PztQjR8MPPPezXnEbWb9ZTiFgzUo5xutt8b42+oYKAHwdjw/AAR9HRKG6lAr7 MJkNlXBkP5NlSqfRNHIhGTdugceCu3Z+aGILcUW2N2zMM9uyZOFvbeAuBU9Lnup+bfxg DtjiWSz+fxS/BkxNFCyA+5NFOnb1u+ht8I4zUv2G6wXdydYeY5YN9U86Kttzlqeyrh7I URN+LLm7n6+n4pf7omMCJpOkRagGXhnwy7bCdU4BLbiGDMmD09I4xzR6XAFEHITeOUNf ni6w== X-Gm-Message-State: AOJu0YzjMYn2WmFX+KgGf4xNbMu2Fj9l7jd9IhRIdSk7swn3iRd30kZ+ NTrd/TG6fMoEyON6jXZcU+9MVRVORSLSJrFqCXl7a263lacD5sVVRPrPoQa4TD2zR1fxp5fV8h+ SfvxUj++tmhwPzjF/VgTl79x1GEynTxCtMtBr X-Received: by 2002:a17:907:7742:b0:9a5:d657:47ee with SMTP id kx2-20020a170907774200b009a5d65747eemr2413301ejc.58.1694618561496; Wed, 13 Sep 2023 08:22:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCeVwF2+JcYHZGB2lIjCz1DTX4prKbW5ev4Hq7EfxD4YhEjBelhKvfKIbxLCPEf3bhJHP1ig== X-Received: by 2002:a17:907:7742:b0:9a5:d657:47ee with SMTP id kx2-20020a170907774200b009a5d65747eemr2413286ejc.58.1694618561127; Wed, 13 Sep 2023 08:22:41 -0700 (PDT) Received: from maszat.piliscsaba.szeredi.hu (79-120-253-96.pool.digikabel.hu. [79.120.253.96]) by smtp.gmail.com with ESMTPSA id q18-20020a170906a09200b0099b8234a9fesm8640663ejy.1.2023.09.13.08.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 08:22:40 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein Subject: [RFC PATCH 0/3] quering mount attributes Date: Wed, 13 Sep 2023 17:22:33 +0200 Message-ID: <20230913152238.905247-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: bulk List-ID: Implement the mount querying syscalls agreed on at LSF/MM 2023. This is an RFC with just x86_64 syscalls. Excepting notification this should allow full replacement for parsing /proc/self/mountinfo. It is not a replacement for /proc/$OTHER_PID/mountinfo, since mount namespace and root are taken from the current task. I guess namespace and root could be switched before invoking these syscalls but that sounds a bit complicated. Not sure if this is a problem. Test utility attached at the end. --- Miklos Szeredi (3): add unique mount ID add statmnt(2) syscall add listmnt(2) syscall arch/x86/entry/syscalls/syscall_64.tbl | 2 + fs/internal.h | 5 + fs/mount.h | 3 +- fs/namespace.c | 365 +++++++++++++++++++++++++ fs/proc_namespace.c | 19 +- fs/stat.c | 9 +- fs/statfs.c | 1 + include/linux/syscalls.h | 5 + include/uapi/asm-generic/unistd.h | 8 +- include/uapi/linux/mount.h | 36 +++ include/uapi/linux/stat.h | 1 + 11 files changed, 443 insertions(+), 11 deletions(-)