From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B7DEC433E1 for ; Tue, 11 Aug 2020 21:18:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5ACA220781 for ; Tue, 11 Aug 2020 21:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597180683; bh=H697I+zAaTrCDiFR/QxpngC4s+tbXs3+JE4nJBDzzfA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=XQqHYYW9V+poT3+cQTmH8wQzwuU7niqqaP11rREl5pc0WuJn9Xpl0diw8YbzByjby qqC6ZkAJvZoBd+9s9fZ+KTlKZQQKZBqKBz8MPrbEIqCb11gdRd7hacrpCJHinplCBF pEMVTTsAZjJBIdjxWyUTQV9kxujqRJokq7cFXAyI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbgHKVSC (ORCPT ); Tue, 11 Aug 2020 17:18:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbgHKVSB (ORCPT ); Tue, 11 Aug 2020 17:18:01 -0400 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C1C72214F1 for ; Tue, 11 Aug 2020 21:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597180681; bh=H697I+zAaTrCDiFR/QxpngC4s+tbXs3+JE4nJBDzzfA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tK2CUSAYGJsXC5JeDzxddiaRcH9cSe3p7Fz9EbTt74CjnD60QIkwqw4vvNHVT4ACh k8OJdYzfRcSknn79jqH5aZ7+zPt0lwvNeqsUB4IiILuEyl7X0VzGp5mhon5W5y90Os iDR/mF3JdxH+U4oF2F+FVjl0qmG7VCiROIuzIczU= Received: by mail-wm1-f51.google.com with SMTP id c19so2894606wmd.1 for ; Tue, 11 Aug 2020 14:18:00 -0700 (PDT) X-Gm-Message-State: AOAM530iEZh4+QNYmbUhQAq5kilKi6Z52Lm0rsnwYKHFzJU7gIhTNy2V 1QXWcegFJA4W4f/tynY1+pbn+ikmOZt3ekylqK2rjg== X-Google-Smtp-Source: ABdhPJws+21t6FOJ6sK8kO00+QCrfmrTy0qT7N99L+sWIie61bUyPjWf7GBWU+7WzuyTe6ork3V+hpcBZbDKW738l/Y= X-Received: by 2002:a1c:7e02:: with SMTP id z2mr5576013wmc.138.1597180679149; Tue, 11 Aug 2020 14:17:59 -0700 (PDT) MIME-Version: 1.0 References: <5C8E0FA8-274E-4B56-9B5A-88E768D01F3A@amacapital.net> In-Reply-To: From: Andy Lutomirski Date: Tue, 11 Aug 2020 14:17:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: Miklos Szeredi Cc: Jann Horn , Casey Schaufler , Linus Torvalds , linux-fsdevel , David Howells , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , Linux Kernel Mailing List 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 On Tue, Aug 11, 2020 at 1:56 PM Miklos Szeredi wrote: > > On Tue, Aug 11, 2020 at 10:37 PM Jann Horn wrote: > > If you change the semantics of path strings, you'd have to be > > confident that the new semantics fit nicely with all the path > > validation routines that exist scattered across userspace, and don't > > expose new interfaces through file server software and setuid binaries > > and so on. > > So that's where O_ALT comes in. If the application is consenting, > then that should prevent exploits. Or? We're going to be at risk from libraries that want to use the new O_ALT mechanism but are invoked by old code that passes traditional Linux paths. Each library will have to sanitize paths, and some will screw it up. I much prefer Linus' variant where the final part of the extended path is passed as a separate parameter.