From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D301C55194 for ; Fri, 24 Apr 2020 10:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23C3620776 for ; Fri, 24 Apr 2020 10:07:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eAhRMSwi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgDXKHV (ORCPT ); Fri, 24 Apr 2020 06:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726289AbgDXKHU (ORCPT ); Fri, 24 Apr 2020 06:07:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72F1DC09B045; Fri, 24 Apr 2020 03:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=Tp5Mwh7r6IJcLAecCyqpJ/TIyjlhLNkCAk6T+XXKm0U=; b=eAhRMSwilNFW7B7zKTBZ5alNKJ fPFREmSw0xGNKNBzK63sZg1a8xpj8CJScj/VFUbRZx1x1NAI5Fm7fHAmBMl5pyeTQfDWTF7DQOL7F 9HwgWkueNAYejVuEyAhJAeIYAjIkCNLaHnVj1NgOOu4ypyjJO7Ljcwh01WYh1enEfR8BfimD5u5jt 1E8TEyq8yUJRI5PdA8rSafyMhUwNbcAMeuv6b31PjFl3sqakCabOOS7qd85J6tc0bBViPQ4z8lZ5U V4f1BYJ7HhnPZ6KQbVS5s8mc6eH1hUx4pjz0aVVffEu/E6MEjZhZNjVyidcCw7fHc8PGB3Xy3LI9X bIz6dzRw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRvEt-0000Ni-Cx; Fri, 24 Apr 2020 10:07:19 +0000 Date: Fri, 24 Apr 2020 03:07:19 -0700 From: Christoph Hellwig To: Ritesh Harjani Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, Alexander Viro , "Darrick J . Wong" , Christoph Hellwig , Jan Kara , tytso@mit.edu, "Aneesh Kumar K . V" , linux-ext4@vger.kernel.org Subject: Re: [PATCH 1/2] fibmap: Warn and return an error in case of block > INT_MAX Message-ID: <20200424100719.GA456@infradead.org> References: 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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Apr 24, 2020 at 12:52:17PM +0530, Ritesh Harjani wrote: > We better warn the fibmap user and not return a truncated and therefore > an incorrect block map address if the bmap() returned block address > is greater than INT_MAX (since user supplied integer pointer). > > It's better to WARN all user of ioctl_fibmap() and return a proper error > code rather than silently letting a FS corruption happen if the user tries > to fiddle around with the returned block map address. > > We fix this by returning an error code of -ERANGE and returning 0 as the > block mapping address in case if it is > INT_MAX. > > Signed-off-by: Ritesh Harjani Looks good, Reviewed-by: Christoph Hellwig