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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0625AC4332F for ; Fri, 10 Nov 2023 17:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbjKJRnl (ORCPT ); Fri, 10 Nov 2023 12:43:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbjKJRmd (ORCPT ); Fri, 10 Nov 2023 12:42:33 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A04431CC for ; Fri, 10 Nov 2023 09:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699635990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=NIZFwo+4TtJxX+MehT6Ekh0B/R7ATGmbr24QUTPhoNE=; b=NQ74hhpU0MkHkT6ZwBGjMlSN7UduupAGZQKDAMlaxcpxMG+d0JmVoiBdNLCGzMDYgXxyQf hQkc1kFswRskL3jbxHaAijB8YCOYUkBVl1VMcRJcNXoPrp2sa0IrxhPqvEdCqncdRmghfs bHj2NPMHYkjT/7PqkadLq6PMM8Zsp1U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-696--b21MyKUN3a1cwZoFSNvbQ-1; Fri, 10 Nov 2023 12:06:28 -0500 X-MC-Unique: -b21MyKUN3a1cwZoFSNvbQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8751C85A59D; Fri, 10 Nov 2023 17:06:28 +0000 (UTC) Received: from cmirabil.redhat.com (unknown [10.22.16.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B44D502C; Fri, 10 Nov 2023 17:06:28 +0000 (UTC) From: Charles Mirabile To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, Charles Mirabile Subject: [PATCH v1 0/1] fs: Consider capabilities relative to namespace for linkat permission check Date: Fri, 10 Nov 2023 12:06:14 -0500 Message-Id: <20231110170615.2168372-1-cmirabil@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a one line change that makes `linkat` aware of namespaces when checking for capabilities. As far as I can tell, the call to `capable` in this code dates back to before the `ns_capable` function existed, so I don't think the author specifically intended to prefer regular `capable` over `ns_capable`, and no one has noticed or cared to change it yet... until now! It is already hard enough to use `linkat` to link temporarily files into the filesystem without the `/proc` workaround, and when moving a program that was working fine on bare metal into a container, I got hung up on this additional snag due to the lack of namespace awareness in `linkat`. Charles Mirabile (1): fs: Consider capabilities relative to namespace for linkat permission check fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 89cdf9d556016a54ff6ddd62324aa5ec790c05cc -- 2.38.1