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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 B1FE4C433E1 for ; Fri, 21 Aug 2020 15:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82C9520656 for ; Fri, 21 Aug 2020 15:05:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="haDU8LPc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727887AbgHUPFa (ORCPT ); Fri, 21 Aug 2020 11:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgHUPF3 (ORCPT ); Fri, 21 Aug 2020 11:05:29 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA273C061573 for ; Fri, 21 Aug 2020 08:05:28 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id w14so1196010eds.0 for ; Fri, 21 Aug 2020 08:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CFHd1R652j9IVdzjEHHv8CJFVu6cveWEKM1K8aqJjrQ=; b=haDU8LPcBr5xa7coersCLI6x4maLKVPLvitqPKOHCnpauOP1/pvLs2510Iwf64iV+d D+53HDw8XmunesV1pTwDVXIgCrdaYMnyO/HfzsTpcCMtw+Xa5D+8K9cL3wttaGffuJia 4/C/t5tGfNpqjjoRqnQB2flfHY7xWltIH+JZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CFHd1R652j9IVdzjEHHv8CJFVu6cveWEKM1K8aqJjrQ=; b=rZWrNipLH9ZwiTxtFb8rYf4q4hDgewiRkWubcrP1GHBhjDZioIiL++hSWMnL383RYe raTHSc8bYTcV/OGTWhyjq1LMKx3DfJq3IFG8Q7ie/XEU5CkItWPzBN0UjYVbGXi8Vqih 33tubclHEYrEgMCNhR+m/rUTXSfEkGdxm3IgHM9jUlCXxhRNvaWG0SjODJO09Q1/DHb5 tA5peud9B9PHKW688gNglIxkaVFWEYDzAAH5nXr1n0zYBHVzqyIOmicAvx97fM/CnhLa N4FjJEQ448GaGvxfMqXQqXiSJooHgjpAW6VxkP1hiCfU84LHo/Oisredw8DoJEDJgcmo 4Uww== X-Gm-Message-State: AOAM5333cAb8qSD+uhbQVqns1PwRrIMMnW/0je9okNHoRgvhp9c1R5QB xSBgbdyHQmEQ8ID06rmMhtGVBTQmD/jKuFfEfeeqNwPPhws8ISut X-Google-Smtp-Source: ABdhPJzcr037VNbPOD+6hlghFKR1xaVqFxy5gzUmjYnygmJoe5HQAhd6z/LEYzkTlFf//1/HZWjWUOomMzEwW21dSEw= X-Received: by 2002:a05:6402:1bc5:: with SMTP id ch5mr3141317edb.364.1598022327613; Fri, 21 Aug 2020 08:05:27 -0700 (PDT) MIME-Version: 1.0 References: <20200724183812.19573-1-vgoyal@redhat.com> <20200724183812.19573-5-vgoyal@redhat.com> In-Reply-To: <20200724183812.19573-5-vgoyal@redhat.com> From: Miklos Szeredi Date: Fri, 21 Aug 2020 17:05:16 +0200 Message-ID: Subject: Re: [PATCH 4/5] fuse: For sending setattr in case of open(O_TRUNC) To: Vivek Goyal Cc: linux-fsdevel@vger.kernel.org, virtio-fs-list Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Jul 24, 2020 at 8:38 PM Vivek Goyal wrote: > > open(O_TRUNC) will not kill suid/sgid on server and fuse_open_in does not > have information if caller has CAP_FSETID or not. > > So force sending setattr() which is called after open(O_TRUNC) so that > server clears setuid/setgid. I don't really like the fact that we lose atomicity if handle_killpriv_v2 is enabled. Let's just add a new flag to open as well. If a filesystem doesn't want to add the complexity of handling that it can still just disable atomic_o_trunc. Thanks, Miklos From mboxrd@z Thu Jan 1 00:00:00 1970 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CFHd1R652j9IVdzjEHHv8CJFVu6cveWEKM1K8aqJjrQ=; b=haDU8LPcBr5xa7coersCLI6x4maLKVPLvitqPKOHCnpauOP1/pvLs2510Iwf64iV+d D+53HDw8XmunesV1pTwDVXIgCrdaYMnyO/HfzsTpcCMtw+Xa5D+8K9cL3wttaGffuJia 4/C/t5tGfNpqjjoRqnQB2flfHY7xWltIH+JZU= MIME-Version: 1.0 References: <20200724183812.19573-1-vgoyal@redhat.com> <20200724183812.19573-5-vgoyal@redhat.com> In-Reply-To: <20200724183812.19573-5-vgoyal@redhat.com> From: Miklos Szeredi Date: Fri, 21 Aug 2020 17:05:16 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Virtio-fs] [PATCH 4/5] fuse: For sending setattr in case of open(O_TRUNC) List-Id: Development discussions about virtio-fs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vivek Goyal Cc: linux-fsdevel@vger.kernel.org, virtio-fs-list On Fri, Jul 24, 2020 at 8:38 PM Vivek Goyal wrote: > > open(O_TRUNC) will not kill suid/sgid on server and fuse_open_in does not > have information if caller has CAP_FSETID or not. > > So force sending setattr() which is called after open(O_TRUNC) so that > server clears setuid/setgid. I don't really like the fact that we lose atomicity if handle_killpriv_v2 is enabled. Let's just add a new flag to open as well. If a filesystem doesn't want to add the complexity of handling that it can still just disable atomic_o_trunc. Thanks, Miklos