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,URIBL_BLOCKED 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 7F2BDC433DF for ; Tue, 11 Aug 2020 21:18:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B6F920781 for ; Tue, 11 Aug 2020 21:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597180686; bh=H697I+zAaTrCDiFR/QxpngC4s+tbXs3+JE4nJBDzzfA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=vEDokCJrOmtZnvdqRKgsQcqN+9xhhFW6Dba9sfOz2gafq0V3fhKxdYFtTdJfTVk/7 IZIIbI9+kxafCyepUWy1x0BqO/Kx9N5WIuXXKxEfdgMjNkjkCxPXFuQjP5ua2UtukF 6bkbRbHiLvj2yYLKFD+75D8AFF/gtHlY+T4czl0U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726501AbgHKVSC (ORCPT ); Tue, 11 Aug 2020 17:18:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbgHKVSB (ORCPT ); Tue, 11 Aug 2020 17:18:01 -0400 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 B3AD720825 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-f53.google.com with SMTP id 184so44914wmb.0 for ; Tue, 11 Aug 2020 14:18:00 -0700 (PDT) X-Gm-Message-State: AOAM532oMq8Qk9no0HhG4g8DGYYocd1G5fRX/XE3hYOJzLtN1ax12Ah1 sMGVe/Yu3AFV3doHq8bc4WAWHWlyJxfncdBApcgW7w== 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: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: 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.