Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp898339pxb; Tue, 1 Feb 2022 12:43:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsJYPCKVhI8SSb1eUgCVufHfBKCNWLEG3mzXDzqt5kWC94toOnki7W2UfIJRUGwrfQgqbj X-Received: by 2002:a63:3342:: with SMTP id z63mr21650551pgz.434.1643748213734; Tue, 01 Feb 2022 12:43:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748213; cv=none; d=google.com; s=arc-20160816; b=U0u4K4NKp2UgsiPjiwcsDM6+qfzKgLK2qxAusD6F9YCmu2q/nVBuwS1jYtTWra/IKg v8zLXIYQQWKPOZVu8qBOZ9JLMJDOieUxvvH2IN25I3rRL9tiA+ZCAVIWTywDKy4Qm4fy +aa8dLvkXjnDktTyLS3SD4+mk5n8lfaQG+0u2OdXSLGNFR0SRZrk9a3dYORo5da659RY TajLJn38onoCynQyUGI4yVIeXwlqTlgVL0IW9MqMBeT2kOMvd0TS/20cWXTDRJ8BVxTB 1Jfp43vLsLucqT9euVlPVnneG5ekXVo0h/FNZhgepedxXXFRRv8UA3VByuQlhdfIVX+R +GEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z9HAohKO0DaszNqZxW2tjLJF39aNbCLgy2ENJwvkNUU=; b=QuwyfOEjm/KNRuB6EJp+1Cy6RGOdbQp/4X01umQQDJVpnDtat7E/xlnrufXEBiuiFW ZLUAotoG2wDJe4cp2ahrqV0XwxFZdM9P5nPvJ4S+qNL3IqaSnOjuJVZPG1CHsSCKSajw NtxUPel7KLiuTg5UIsMpCN2P0EWSYbf11th8GqhO8rH/QHKekyVs0/4lA5e25A0Oz0+r gflOIu02m1X8sfz5Zx9HoMICPo+VdB6Z9XzNo0weEPUj/NYGJvCdRKHZuAsXW705tASS DZ53HgE+dvkRNFR3X4j5dEWAwBdF0w3ZzdV2GT8fah0AdsDFf4KsrgiqBswUTOcStk/5 WnOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QO8bd6Yw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u71si14979365pgd.831.2022.02.01.12.43.22; Tue, 01 Feb 2022 12:43:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QO8bd6Yw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379711AbiAaPhR (ORCPT + 99 others); Mon, 31 Jan 2022 10:37:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376980AbiAaPhP (ORCPT ); Mon, 31 Jan 2022 10:37:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A70E0C061714; Mon, 31 Jan 2022 07:37:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 52F27B82B51; Mon, 31 Jan 2022 15:37:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 125E3C340E8; Mon, 31 Jan 2022 15:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643643433; bh=n4pF0WTD8mzI8jApP59+6mO09uKqNqOupqmX+4f7jRk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QO8bd6YwcVynrWLeUHJiup6FETqxBrt5l8FJYwCvJs/JayrA0saN0XoC2+Yi4iOeb DnE+nmh6kh0XRjoqhy7B/yMAkmIZRcODgKjW2wcsOluZkn0tPXFfMePt1lZAMke6NL Kp9NuRE7JWzvN9/n6wSEZAOTfXcfsUZrDmTqwJidpsWC4365LQzisynhfF2+0bjd9X wdGeyI5gtwiMDs+jRdPq/DBG4vRKcN1JSHQRalDJcmVshoYq0d1uKiZtnLC9RtJdXq CgTYbUbzZI1e677E4tEko0HGJHCR856BNRlgglATA6+ZBd4SC2GWyTchpzPy7W+30T SpEc1n09nuJTw== Date: Mon, 31 Jan 2022 16:37:07 +0100 From: Christian Brauner To: Matthew Wilcox Cc: kernel test robot , Kees Cook , Ariadne Conill , 0day robot , Michael Kerrisk , Rich Felker , Eric Biederman , Alexander Viro , LKML , lkp@lists.01.org, Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [fs/exec] 80bd5afdd8: xfstests.generic.633.fail Message-ID: <20220131153707.oe45h7tuci2cbfuv@wittgenstein> References: <20220127000724.15106-1-ariadne@dereferenced.org> <20220131144352.GE16385@xsang-OptiPlex-9020> <20220131150819.iuqlz3rz6q7cheap@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 03:19:22PM +0000, Matthew Wilcox wrote: > On Mon, Jan 31, 2022 at 04:08:19PM +0100, Christian Brauner wrote: > > On Mon, Jan 31, 2022 at 10:43:52PM +0800, kernel test robot wrote: > > I can fix this rather simply in our upstream fstests with: > > > > static char *argv[] = { > > "", > > }; > > > > I guess. > > > > But doesn't > > > > static char *argv[] = { > > NULL, > > }; > > > > seem something that should work especially with execveat()? > > The problem is that the exec'ed program sees an argc of 0, which is the > problem we're trying to work around in the kernel (instead of leaving > it to ld.so to fix for suid programs). Ok, just seems a bit more intuitive for path-based exec than for fd-based execveat(). What's argv[0] supposed to contain in these cases? 1. execveat(fd, NULL, ..., AT_EMPTY_PATH) 2. execveat(fd, "my-file", ..., ) "" in both 1. and 2.? "" in 1. and "my-file" in 2.?