Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2896193lqp; Mon, 25 Mar 2024 12:17:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjflWqcxXFb7zDR7QBynl8gPreuaFcNDEWzG4KNfZoNHcmLul6d4hujL721V4UcMmm2BVGf3FZWaJO3CIcTqLymcdM7K9njthQt5xcCg== X-Google-Smtp-Source: AGHT+IF+mtb4qzFozbxQqXXJaCLPf52OcrPmyPHZ5qtvH+n5PfcreGX9nURRArnrH/0LWyDuVFZq X-Received: by 2002:a05:6214:c84:b0:696:8ecf:5734 with SMTP id r4-20020a0562140c8400b006968ecf5734mr3834984qvr.12.1711394241348; Mon, 25 Mar 2024 12:17:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711394241; cv=pass; d=google.com; s=arc-20160816; b=LLADwSRMdIZ7sIBZCr8O4QjsILaNZaLttt8lZA19+t2c0Tbwae+fix6ki73/9mqG4e CKgm5tfnXKUaxkK2hR93qxEzc5tOi98zR/mQadHa4zmGIhMs5FPs89UPV5hkzFl0iQDY 1eqcAT4IdnyZGQ+vvwaPQU5UooG9CXmaif+O0Fh9/PiIGm9HHbl0Ar/T96icqTSkvc+L GdQoUSHDt8fvCSh4wWxv9Z6BWu3TTilrxGLW7GUQTrrDKmNQf/99uAF19wwLIVHjF4SE C6ViMEcy2DVfAzqn1zzojZqjJkTySBdZyp/3RjdB7RUOte/dOIe7KUhlGv2PRUvRA41g iheg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=8uEgl58apLNyzovccmMCRU9q170bGqNSFjc+5DQd8mo=; fh=txXoHg8lp15tFR0aKx33XhtpWOxJcD6d+4HnJRl42PA=; b=X9AvagId5uaBxEkWsxlJfU/xwfA3NA27+2ZIE6GKWVoh4PRroA/AVBi+YKjbfzJOr0 F+diZVZ67u/Ohu3ncV/b52iVyFWjvwnaK0Jm7ePZ86OwgiXeMS/oSO5VMEg+iaE00Ms9 D9TXBkeRJwuZHegLOrv0b8J3At0UGBaMf8zNGxH7TqFS5agCceNx+bPKkResNxQyPK4w oXWFxwg365SdI63pp+fjLucNyVU6asumUVdhqHNEIi/F70B9iBUURit84cL+L5GO+Ozx rtEs0Rh+DVMze2FtjGReMTGIoCMGU8lJ+J1eGJAJx1yTR9E93RWKqgqciCbWBWDdJkn1 d6wA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QIudOJ9I; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Cj2ypcyX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-117794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117794-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u13-20020ad45aad000000b0069689e5f980si3343428qvg.219.2024.03.25.12.17.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 12:17:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QIudOJ9I; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Cj2ypcyX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-117794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117794-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4547C1C6191C for ; Mon, 25 Mar 2024 19:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6106168DA; Mon, 25 Mar 2024 19:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="QIudOJ9I"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="S1J3EIl0"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Cj2ypcyX"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="x2SsD2Mn" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 133661773A; Mon, 25 Mar 2024 19:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711394213; cv=none; b=VOryPVqdI0WRKTUOt0gF1u7Kb+yS1sTkobctd1ufseGJyVQOB3NH8XYfDVVYHADLwpX5M2132IJMYzJ6IspWaTpCsINghGxlqs6IARM/kGAa0I9K1V614KYZ9cEgOLa4Rl/75PUe441pBRw5j3ApUmV9Nyy4XM700GzZ58HLqbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711394213; c=relaxed/simple; bh=FS/JzakntYFsXIiZNXo/X5qSz+O9mZ/aKMbnCCtBXkg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E/OK8ApbVKYwveYQhHWMrRw8De4tG25vxCSlTrGBtUnhaENqhkzSJfbIG34VAAZQbLwGPeJisL/O1O2xpvG14SS26HO37LJh8q0CvcWdpE0ekb+ILlZx6dQ4spg2PZ7vxqJ9LdyGx3w4A95G0LYzjIJgvnBFOoLnzPe9mPAvxTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=QIudOJ9I; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=S1J3EIl0; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Cj2ypcyX; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=x2SsD2Mn; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 166015CABF; Mon, 25 Mar 2024 19:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711394210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8uEgl58apLNyzovccmMCRU9q170bGqNSFjc+5DQd8mo=; b=QIudOJ9IA5Gyl9TJng1RsA5V+AH0AQVVu8gB3SmTqRzaYk4hFUzwcHOSyvOlEJmTecbiuf qF23SN152RkBZ1ra7oFZlxsXEtC/0XazsSujTQwwIEH0/BkYZ4TJqWpEQIWyMUfLv+A2UZ CvFqdkAfphiN2HXM85I9uR/PnDOta08= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711394210; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8uEgl58apLNyzovccmMCRU9q170bGqNSFjc+5DQd8mo=; b=S1J3EIl0sQI9g5hv1Ggc6IfxpR+2zSp9tAB+R/iVR7jliAskC/bjd6YBU3L4PgXaaHWvel DEphlMEDgNaNuUBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711394209; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8uEgl58apLNyzovccmMCRU9q170bGqNSFjc+5DQd8mo=; b=Cj2ypcyXMUs8QcS4hsS1TLkYl5BWPYmVxXdmS6JyA7i+8wQuTtWMybl0WvBl+zmPG3HEYe 3eOeUhl2hPjh96Aq9XuNZO7Do9gDcvkMar9sJH/y4aJYK4IVSMK7o+Gxt2NwoFYAeOWi1p CLUqMuniDPrYHcq7/HclaTZ6rSkqvhA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711394209; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8uEgl58apLNyzovccmMCRU9q170bGqNSFjc+5DQd8mo=; b=x2SsD2MnxX89ObKQ/1JOjZDAPzG2bLS9N4uzex3BYpgFo0cWyIHobMhooGiD5ftA/ELs1q kbww13Zq3d1DLSBA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id F1A9013A2E; Mon, 25 Mar 2024 19:16:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id qVC7OqDNAWaLZwAAn2gu4w (envelope-from ); Mon, 25 Mar 2024 19:16:48 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id CE0F1A0812; Mon, 25 Mar 2024 20:16:45 +0100 (CET) Date: Mon, 25 Mar 2024 20:16:45 +0100 From: Jan Kara To: Nikita Kiryushin Cc: Jan Kara , Amir Goldstein , Matthew Bobrowski , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] fanotify: remove unneeded sub-zero check for unsigned value Message-ID: <20240325191645.viuo2f2zujx67ec6@quack3> References: <> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Score: -0.82 X-Spamd-Result: default: False [-0.82 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; DBL_BLOCKED_OPENRESOLVER(0.00)[linuxtesting.org:url,suse.com:email,ancud.ru:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[suse.cz,gmail.com,google.com,vger.kernel.org,linuxtesting.org]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.02)[54.71%] X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO On Thu 14-03-24 16:36:56, Nikita Kiryushin wrote: > > Unsigned size_t len in copy_fid_info_to_user is checked > for negative value. This check is redundant as it is > always false. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 5e469c830fdb ("fanotify: copy event fid info to user") > Signed-off-by: Nikita Kiryushin Looks good. Added to my tree. Thanks! Honza > --- > fs/notify/fanotify/fanotify_user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index fbdc63cc10d9..4201723357cf 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -502,7 +502,7 @@ static int copy_fid_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fh *fh, > } > /* Pad with 0's */ > - WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN); > + WARN_ON_ONCE(len >= FANOTIFY_EVENT_ALIGN); > if (len > 0 && clear_user(buf, len)) > return -EFAULT; > -- > 2.34.1 > -- Jan Kara SUSE Labs, CR