Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp359508lqh; Tue, 7 May 2024 00:56:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmqUkLIeOhFzyY/ZAz7zrfpPU4X0TmILJEYV7t7BM+aWa/z56hQ5dJAUFfBCRfsZYh8M9pZVXy93E+EF6et7Sf80Jt6XXVQmoYkVA/IQ== X-Google-Smtp-Source: AGHT+IFs4nZRpcolEWzUAI4cgHD3bFsmWTYZDk6iMVl94b8SPMhgL3xolqpzH/GCwuMHITyPlmcV X-Received: by 2002:aca:130d:0:b0:3c7:534a:f260 with SMTP id e13-20020aca130d000000b003c7534af260mr11702014oii.52.1715068616932; Tue, 07 May 2024 00:56:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715068616; cv=pass; d=google.com; s=arc-20160816; b=JuXSfG/iUWPcLxVcl9EhQcFd7BAvYymRhuOg4NKCMvg1lpX2pZCqgP8KQ3xrTJP5D0 6n7j6ZBr8OvjWgQ/Zphj/QyIM/NbdmF89QWvQEOBeta/9FhhKvj1s5g8ZmfgKCvgKpWu KbjL4rjXVrGeYOB7oYIwuOJYfn5DRGXjd1XYyjud4Exgp5j+rsUxscFzNjF9lOGhKTzM rBsoTKBBr4r+uauXV9cZhyScVS8sC0+Zb2sdNWHwIoYMFi+xZQIYtyKirZFyehMnsVRe t5p+B1QaQpa9e14/ZXY9fh6IkITr4eCVQ0qt+93EmehTT3zs/nsZvjY7ddpK5aMyYEqg Y9xw== 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; bh=WuIN6nq3/l8uVmPgn8xJBtIN3q6SKM4SUD2H711BSy8=; fh=+HkSo+MWl06jcaDIt/Ybo3pLzSSGA0QoNCMr6+8gFec=; b=nKoEo5yIXr9YZ2Rl0CTPviOZk/ArHvmbY8FH3RcP7juudvqvIU0lIDtLAO7f6Ii53+ /qkRWMd4eduYlidJ1q2Sj2vuEhyZCcUZUwtM1JAWQuh7vkEEg40LdP3f2o2ETxuSwJDq wU86NZJZIdOfNCPpQRy6AOfq5F+mGodWTL7U50cKHaA5vyrHC9XduWdlIEoXIICOspzf 3MBTx33JxuvME1NT6V1B4SydOcQ6z2NXv5phkunmHy+i7UW6nm+LKC9jsnOB8OoGAh3x dpj1R4ZxrUHsMK5XNChWgb9trnvzaQ84ztQAtqzERR87xzTw0UTWkbWowPCfrQTYCm6w ne8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="m/KDuJpq"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-170768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170768-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j12-20020a05621419cc00b006a094278bf1si10981566qvc.328.2024.05.07.00.56.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 00:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="m/KDuJpq"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-170768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170768-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 9937A1C2205E for ; Tue, 7 May 2024 06:40:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37FF178C7D; Tue, 7 May 2024 06:40:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="m/KDuJpq" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6F81177F12; Tue, 7 May 2024 06:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715064028; cv=none; b=ZEKtLsosgu8seq4BkXIvYAPUl6T+R/l1ON6PKfiIc/tDitKt2Mip1xe1yccgpiXA8yRoYTG6SbiFKAXkh+WfdwEMdbB1WQ0Z12tymxIVUNH+0BTmDRvI8wYkR50I+gNhbMP+ieXDico/YxVyxRzQePZ7ekSJ7biwfJt0IGShOjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715064028; c=relaxed/simple; bh=C2mqlbjChb+Zb4jizOt6/qiS5xaLrNfrCbMuByqaQFM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=usPp0xT/8AtVdnGtKnhSu6qaBCYazOxHlsKmBmfO99j2DFr6VcuysP8P4L49G2CGKgOpiPO/36G8ayVJ6REErSP4285Od8hL/y0wH1BwCvpgCS2EdZxrEiYFexuEWbLWFOseeHct4Hs1Lqic90Jm7EgpKd58YLQ6cfPnxwCmZGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=m/KDuJpq; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WuIN6nq3/l8uVmPgn8xJBtIN3q6SKM4SUD2H711BSy8=; b=m/KDuJpqz7ZZkloXUJ4oV1/tMg e9CfJZ6n0M8BcvcddzDeJ/7/YSmZaMH3FzXBFQEa5U5pPtyQkWiXw8YHjzBZHLiUp9TVmyyTcjS1l GCR44wkemCeDjQ70sMYUnQbt8ckhIsnoRvy/1Q8ZonIiXgpO+dGckhZiytPSTyiS3s/gElCf+rKPv p44Q+xLijOz3bl/Gt1+/BWYL88cKmRgKSt5fqhysBgtFM1YNicOfNnnksovgse0pbphft3yzCDM3N oVQDSAp6KXtgPjq32cQz21jcWC2bftzoc8IvueuyHuKarH6JWHrHbz+hFyshNL5zbFeOi4Cfclamp EVkLXtEA==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4EUz-00000009s5C-2ZTA; Tue, 07 May 2024 06:40:25 +0000 Date: Mon, 6 May 2024 23:40:25 -0700 From: Christoph Hellwig To: Dan Carpenter Cc: Christoph Hellwig , "Darrick J. Wong" , Chandan Babu R , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] xfs: check for negatives in xfs_exchange_range_checks() Message-ID: References: <0e7def98-1479-4f3a-a69a-5f4d09e12fa8@moroto.mountain> 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, May 07, 2024 at 09:33:40AM +0300, Dan Carpenter wrote: > On Mon, May 06, 2024 at 11:06:17PM -0700, Christoph Hellwig wrote: > > On Sat, May 04, 2024 at 02:27:36PM +0300, Dan Carpenter wrote: > > > The fxr->file1_offset and fxr->file2_offset variables come from the user > > > in xfs_ioc_exchange_range(). They are size loff_t which is an s64. > > > Check the they aren't negative. > > > > > > Fixes: 9a64d9b3109d ("xfs: introduce new file range exchange ioctl") > > > > In this commit file1_offset and file2_offset are u64. They used to > > be u64 in the initial submission, but we changed that as part of the > > review process. > > I've just checked again, and I think it was loff_t in that commit. > There are two related structs, the one that's userspace API and the > one that's internal. The userspace API is u64 but internally it's > loff_t. Ah, yes. The in-kernel ones probably just needs to move to use u64 as well.