Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2280980rdb; Wed, 21 Feb 2024 02:49:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKVMnl5ITZjaGYvV2DCKCXyhmP9v8FxsnzhUde6d9mxEvdmu8ZK7CsPrgTxeVIEuP1Rwks6XLIKi/cSC7820XsnoxE5LAxZLh+IQoalQ== X-Google-Smtp-Source: AGHT+IFe0ovx7cZstmGDb97jlCOER29Z1UWAoyTOmmSwpFNsw12pPxFfSvSCk5jRPdV5N+WfB7rz X-Received: by 2002:a17:906:5586:b0:a3e:6eee:f108 with SMTP id y6-20020a170906558600b00a3e6eeef108mr6345711ejp.52.1708512577987; Wed, 21 Feb 2024 02:49:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708512577; cv=pass; d=google.com; s=arc-20160816; b=FJx/kVBw4nABtPCVhVs7mna0Gss2DMqLRYsRkRa/jSTAd9VWe6CL9xs/EqKH0p1u5T 6/4jgv54LYZMeT03SePJ/pIddqbkHWgdK8O+m04bcL1+l2QMPJdRpLSBkTeJJZ3bRnp9 pdQt3iE8mH9OvbQZQ0gU3qGA3PHPOZWXu5I/GgBhQ7qvzH6nugXTcKO8CZRNH7gJvcGL nEloblrJp0Y4wwJ2e3Wk2JztZc3lrrIB+HcIFZ/roWQ4APcGa/O4/nf7KIr5gSmytAxq WpZIPtWbhr5Tek5X3MRw/zt3K/Mn9bAAcRxiZanwaEKxMLzTCki9DYx0vgQvURE74WnG oGcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ezPF6zg6B91jSrXKMzEgnvbtAPMBcU4QvSvW5Zy478M=; fh=Xay1inJnxGYEjNzSnwRtyZLrV3J99bh1b77+QPXVcO0=; b=To96QZTD8kX2/w1d69XrQzUjMk0QrJicFuQCXR6pESvjzTxIo/JBy7c3BXUGG21NUS xmu9oH25OhK7imD5G2MTbD4b55pRSOnPMg85/U+Fhvd5nUZ4YDzmhVpF3PCZe5prcyyI fJZcUP7s0IcjZtpxPD8YM6JH23w4OseiXGofFS4iDGT+0rdZVLFSZAdlbChRfo24qMK4 UWN2JGW2VHbLN2ZqCXQvua0d6BwIiYGkrRkaYoLjMu+fJyrNa86dyIwkh2lxk2234+sm BgAcPM2prC0K79n8jZoEohST6TrnKZuoe+rItx/CBfbaWNB9w+6+qk+sIjO8g5BdzioM 8XFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=jxfwViVl; arc=pass (i=1 spf=pass spfdomain=xen0n.name dkim=pass dkdomain=xen0n.name); spf=pass (google.com: domain of linux-kernel+bounces-74563-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74563-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id pk16-20020a170906d7b000b00a3e55bacc2bsi3495914ejb.578.2024.02.21.02.49.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:49:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74563-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=jxfwViVl; arc=pass (i=1 spf=pass spfdomain=xen0n.name dkim=pass dkdomain=xen0n.name); spf=pass (google.com: domain of linux-kernel+bounces-74563-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74563-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B8BD01F23FD9 for ; Wed, 21 Feb 2024 10:49:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39CFA3EA66; Wed, 21 Feb 2024 10:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xen0n.name header.i=@xen0n.name header.b="jxfwViVl" Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90D3D3E49E; Wed, 21 Feb 2024 10:49:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.28.160.31 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708512563; cv=none; b=qSOMC1l21bM0IiGify+BnqfftokMYI9jtIOEUOQMIQh9omIEBQNlD97rR+RBjYUHmgp9K9nUX7j7f8odWVGMPuW334tgiaqSXeCcWDbMRgVfn9RUhwdBktNJStPoF9Xr4/xHAjG6jfW/Q74tzmmqZsweSbc5Tacrxbm+XdJKPO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708512563; c=relaxed/simple; bh=mxb+gMGUDBPnZJub2OxpXr5cGn1a7UGyvzYeTJOlnQQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ufl9zoH84K+9BmDf9a0XnDA1H/oJFbvC3+Mh6mR1ZeznNP8aYGbWyw61LrjE0kJ5Xcbkd2NDLFLj7NIp045Kc6Qgpv8/CPEQ5h9bwJV/F6UCLfcguOHL7ePvM4CxjuPJRtE9bH7iOmKFbO9RDccBJz0JVFetVjc9M7QrPxe3iTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xen0n.name; spf=pass smtp.mailfrom=xen0n.name; dkim=pass (1024-bit key) header.d=xen0n.name header.i=@xen0n.name header.b=jxfwViVl; arc=none smtp.client-ip=115.28.160.31 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1708512558; bh=mxb+gMGUDBPnZJub2OxpXr5cGn1a7UGyvzYeTJOlnQQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jxfwViVltVdU1XrVjxL2is6j6mZSDlh7cWd6cir0CWPkHl7p2jymVy/+9oUxCXArS GnEw1NKQGBRsTgbJzfEnBwqTW7QPrzQbHgJ1mH5oCtPCuo94UU/Qfhe5VzlXxDltY8 qEjJkNmXM4BDIbSTQWnQZq3QTl/Zo2ZAOUpVUGcI= Received: from [IPV6:240e:388:8d00:6500:8954:615d:4577:1f21] (unknown [IPv6:240e:388:8d00:6500:8954:615d:4577:1f21]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 385B360094; Wed, 21 Feb 2024 18:49:18 +0800 (CST) Message-ID: Date: Wed, 21 Feb 2024 18:49:17 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Chromium sandbox on LoongArch and statx -- seccomp deep argument inspection again? Content-Language: en-US To: Xi Ruoyao , linux-api@vger.kernel.org Cc: Arnd Bergmann , Christian Brauner , Kees Cook , Huacai Chen , Xuefeng Li , Jianmin Lv , Xiaotian Wu , WANG Rui , Miao Wang , Icenowy Zheng , "loongarch@lists.linux.dev" , linux-arch , Linux Kernel Mailing List References: <599df4a3-47a4-49be-9c81-8e21ea1f988a@xen0n.name> <2d25e3bb829cbca51387eb84985db919f50ccd37.camel@xry111.site> From: WANG Xuerui In-Reply-To: <2d25e3bb829cbca51387eb84985db919f50ccd37.camel@xry111.site> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/21/24 18:31, Xi Ruoyao wrote: > On Wed, 2024-02-21 at 14:31 +0800, Xi Ruoyao wrote: >> On Wed, 2024-02-21 at 14:09 +0800, WANG Xuerui wrote: >> >>> - just restore fstat and be done with it; >>> - add a flag to statx so we can do the equivalent of just fstat(fd, >>> &out) with statx, and ensuring an error happens if path is not empty in >>> that case; >> It's worse than "just restore fstat" considering the performance.  Read >> this thread: >> https://sourceware.org/pipermail/libc-alpha/2023-September/151320.html > Hmm, but it looks like statx already suffers the same performance issue. > And in this libc-alpha discussion Linus said: > > If the user asked for 'fstat()', just give the user 'fstat()'. > > So to me we should just add fstat (and use it in Glibc for LoongArch, only > falling back to statx if fstat returns -ENOSYS), or am I missing something? Or we could add a AT_STATX_NULL_PATH flag and mandate that `path` must be NULL if this flag is present -- then with simple checks we could have statx(fd, NULL, AT_STATX_NULL_PATH, STATX_BASIC_STATS, &out) that's both fstat-like and fast. -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/