From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) (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 F0ABF1B2182; Mon, 25 Nov 2024 14:46:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732545968; cv=none; b=n6K9eoFwfBjxnJ3cILsD0EbGJ5MyL0vs/HaMLYDoTpz17hJasad718yOWVu8r31YpUk5n6TBoG1va+v2uz7cquCZZ3pNTPD7AXOmVZRNvVc3OTiYCdGbujXswamfE/XqOSHpZM48bdDLgpLSa9dM0fulFnyquEXkXddytLED52E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732545968; c=relaxed/simple; bh=j8WTzaLvOw9whoSAZSxh39tAF7nm/46SdyfK+BgRXFo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MmpBHkl1CVxH1oNROdRCqheredNVlLKZWIF+OWyDcqzUyX8ecEriP+kIRAwmnA3PFdnK50/ce/g+xwBDV0w9d60dYRm+Aa2GBiDbREAjD2L9iLna3VG0fWeZPKJgglc6mo+MqhlRUpSD7DDPRwpikhNomDTV8c5EnhhqqMXwrRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.fm; spf=pass smtp.mailfrom=fastmail.fm; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b=U/wK7U2m; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MEpTB44T; arc=none smtp.client-ip=103.168.172.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.fm Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.fm Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="U/wK7U2m"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MEpTB44T" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id ECF541380444; Mon, 25 Nov 2024 09:46:02 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 25 Nov 2024 09:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1732545962; x=1732632362; bh=ZzO4Ayzt9QRMmjLtmAvo63cJoNPvzQZtsba8yNiNm1s=; b= U/wK7U2mVbh/6sigFrWl9Y5x+LjoiiZ8WPeMGJuTgTbUyOATuylqFNdiuQYost3l eoXdriAdzSEgc5S1B2ncZDBLadMFcH6/GNMPqcLBlolDZ7AJb/hcclChfnn1jkSH 0VxeOyxhssMW3gmdK5wQRhh7YxYekPIKPfKO3pZPIVF5qPvVC70pnR8ifeHYWXmu y5exwykUHN4/f2vXEvxDJST3czpswWOR+X1FBLr5vq8fUARxc9D39rML2Nmdhulx Qnl5tdZiC0YRVK7wgP5LaUCHKh079VcwPd70ZiZ+n7+NGBPaCt2JN6HP+4wvX/fw MJNEzGegNYeh5306hdJOQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1732545962; x= 1732632362; bh=ZzO4Ayzt9QRMmjLtmAvo63cJoNPvzQZtsba8yNiNm1s=; b=M EpTB44TsLU82wnnqfRomgNk3SdwFTPKRmBEzhHHYpdwvuuMfLUhrfTgGfF4U8xqM vCZCcQUg9ZLLmQWR1X+PptORtTR8N5Fwn7MeX0b+r6engg8iLL0LgaNiGk7vZs+E MQ/Nml2YGCp/0VHM2mtS5JzFrRQXhx/JLm7L3m7FqCxmuD/hObNG4I4cfHQRL8VH j3+xuhNAuX+cT2+no9x1UOmZekCaw4dvHKxXGZBgVOLltPuPLDrGNjQm2eVqCz4G xz817Ig48n40A6bVo6ArQubN6kPXLM0OoP2U3ROr8dMlYI1m2gZXE8KzWPFljZix 83b/IoF5lzKmrHNqeD4hg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeehgdeiiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomhepuegvrhhnugcuufgthhhusggvrhhtuceosggvrhhnugdrshgthhhusggvrh htsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeevhffgvdeltddugfdt gfegleefvdehfeeiveejieefveeiteeggffggfeulefgjeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgurdhstghhuhgsvghrthes fhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpthhtohepuddvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpthhtohep sghstghhuhgsvghrthesuggunhdrtghomhdprhgtphhtthhopegrgigsohgvsehkvghrnh gvlhdrughkpdhrtghpthhtoheprghsmhhlrdhsihhlvghntggvsehgmhgrihhlrdgtohhm pdhrtghpthhtoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehiohdquhhrihhnghesvhhgvghrrdhkvghrnhgvlhdrohhrghdp rhgtphhtthhopehjohgrnhhnvghlkhhoohhnghesghhmrghilhdrtghomhdprhgtphhtth hopehjohhsvghfsehtohigihgtphgrnhgurgdrtghomhdprhgtphhtthhopegrmhhirhej fehilhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Nov 2024 09:46:00 -0500 (EST) Message-ID: <6876e1cf-9bd2-483d-bd49-c52967c88397@fastmail.fm> Date: Mon, 25 Nov 2024 15:45:59 +0100 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v6 05/16] fuse: make args->in_args[0] to be always the header To: Miklos Szeredi , Bernd Schubert Cc: Jens Axboe , Pavel Begunkov , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Joanne Koong , Josef Bacik , Amir Goldstein , Ming Lei , David Wei , bernd@bsbernd.com References: <20241122-fuse-uring-for-6-10-rfc4-v6-0-28e6cdd0e914@ddn.com> <20241122-fuse-uring-for-6-10-rfc4-v6-5-28e6cdd0e914@ddn.com> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/23/24 10:01, Miklos Szeredi wrote: > On Fri, 22 Nov 2024 at 00:44, Bernd Schubert wrote: > >> diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c >> index 12ef91d170bb3091ac35a33d2b9dc38330b00948..e459b8134ccb089f971bebf8da1f7fc5199c1271 100644 >> --- a/fs/fuse/dax.c >> +++ b/fs/fuse/dax.c >> @@ -237,14 +237,17 @@ static int fuse_send_removemapping(struct inode *inode, >> struct fuse_inode *fi = get_fuse_inode(inode); >> struct fuse_mount *fm = get_fuse_mount(inode); >> FUSE_ARGS(args); >> + struct fuse_zero_in zero_arg; > > I'd move this to global scope (i.e. just a single instance for all > uses) and rename to zero_header. > >> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c >> index fd8898b0c1cca4d117982d5208d78078472b0dfb..6cb45b5332c45f322e9163469ffd114cbc07dc4f 100644 >> --- a/fs/fuse/dev.c >> +++ b/fs/fuse/dev.c >> @@ -1053,6 +1053,19 @@ static int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs, >> >> for (i = 0; !err && i < numargs; i++) { >> struct fuse_arg *arg = &args[i]; >> + >> + /* zero headers */ >> + if (arg->size == 0) { >> + if (WARN_ON_ONCE(i != 0)) { >> + if (cs->req) >> + pr_err_once( >> + "fuse: zero size header in opcode %d\n", >> + cs->req->in.h.opcode); >> + return -EINVAL; >> + } > > Just keep the WARN_ON_ONCE() and drop everything else, including > return -EINVAL. The same thing should happen without the arg->size == > 0 check I have to remove the WARN_ON_ONCE condition altogether, gets triggered by /dev/fuse read (i.e. with io-uring being disabled), in generic/062, op code=39 (FUSE_IOCTL). Without the pr_err_once() and printing the op code it would have been impossible to see which op code that is - the trace does not help here. Thanks, Bernd