Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp526384rwb; Thu, 18 Aug 2022 07:52:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PFKDIcTrn0MZqLoejr1ItuVe9eqZcfv6Yj9ZPPx62SZ+wrTigicZFHDwn1laas/b8NXvx X-Received: by 2002:a63:8ac3:0:b0:429:f580:fce2 with SMTP id y186-20020a638ac3000000b00429f580fce2mr2719041pgd.558.1660834352174; Thu, 18 Aug 2022 07:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660834352; cv=none; d=google.com; s=arc-20160816; b=aB/f9zgDHTF8BWWWhbrs10LGoI+Yin7oihrnlHH/lRIyhbayNu89GItQFkROvpPqs3 03eLUrZjpRod4dKqfwvTN0x/1KSUIbT2BUlbhY/nW1hDEcvhKI2qFJ0qa1JdnR0GOK/x RWQOeuLubdN+WWOZs+LOXRqO0Pyum7cSx1xv3UcIpHEpfwrT8HXG7FC3rYrdhXcJMI6A bYpG16+78BYMLprbXjv50wrQPC6cLrYIzaBEdPGpEmXrRDc/c7S7Qtp6sj18YR8653zz 4+YYaXYk630rHzt1LEoOu/Dn7aN5m5SJYlBU+vqRSj2Rjq8LNhX4hbA45ILjnop/2xFQ WO3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kcvfVewPJvPhkIgYC4PjI+fY/pTp+IQ+7EHGsX/jXkc=; b=DE4KeC5WGCvDCrcwfB6qCMZ6qUzq9sOTOngxBkcB2J1LptfAR8xcyMLeS2tcIv2KcT /ENoSZPlC+i9glV8V0i+wcItKS/IqbLFTWd9O7nVZfNCt671I7Wu8LF7QMit/Q1P0bPe ZpS2VsCct6p+Zn6tKH3BRxbSzsH9K3F52XKCUZxt3G0kSnaazjna9MksQ93S1x2CLBL8 MgnLOmQuXiuhj6EjWisBRkL5awtqef/gotgw1spEKzpribJLiH6S4wnBnOFXzqqxqBlo LSI4+kGBPyDoOxUWjD+jwHCbHXLyDSPZ0YTjhVKyhv2fmo44uY+O29xu6LYxGGKMWuSS 8Cqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BLTlKkx4; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a63fc0f000000b004215af5fdb0si1627437pgi.398.2022.08.18.07.52.18; Thu, 18 Aug 2022 07:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BLTlKkx4; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343600AbiHROuP (ORCPT + 99 others); Thu, 18 Aug 2022 10:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343684AbiHROuO (ORCPT ); Thu, 18 Aug 2022 10:50:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6822EB56FA; Thu, 18 Aug 2022 07:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=kcvfVewPJvPhkIgYC4PjI+fY/pTp+IQ+7EHGsX/jXkc=; b=BLTlKkx4WurVPayDWJNAkI2zNs sCVob1kKu+ckvs1ZrBnEMoy/sKzfiWO9Ni/jhwSz5BZww81yfvgcdBjhjGF6ybu35TVci544IE99C BqWwS7mfaTqbWf7yt05HrL1U8PfX2nSaCAT9kXtGCa1rbxShhtYblgfZ+xhi9+Lg36Cx+YQBbUGsr 3v4qigAHqo3dq1AzIOfXSuB0zslO2ILy2Maouz0d5lTB6wLAbDSFS8hB4YBdTAtdAyCLCtXhSsJ+W WXyzna/4JsLROYfsgDOSTiLuDMOi1BYFVbEQOlLVzC3uO85Hbu+ZodK87Po/CFWy+hdcKyVlmNdFq zdhlzPeA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOgqQ-009tn9-KD; Thu, 18 Aug 2022 14:50:02 +0000 Date: Thu, 18 Aug 2022 15:50:02 +0100 From: Matthew Wilcox To: Siddh Raman Pant Cc: david@fromorbit.com, djwong@kernel.org, fgheet255t@gmail.com, hch@infradead.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, riteshh@linux.ibm.com, syzbot+a8e049cd3abd342936b6@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] WARNING in iomap_iter Message-ID: References: <20220818110031.89467-1-code@siddh.me> <20220818111117.102681-1-code@siddh.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220818111117.102681-1-code@siddh.me> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Aug 18, 2022 at 04:41:17PM +0530, Siddh Raman Pant wrote: > include/uapi/linux/loop.h | 12 ++++++------ I don't think changing these from u64 to s64 is the right way to go. > 2 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > index e3c0ba93c1a3..4ca20ce3158d 100644 > --- a/drivers/block/loop.c > +++ b/drivers/block/loop.c > @@ -977,6 +977,9 @@ loop_set_status_from_info(struct loop_device *lo, > return -EINVAL; > } > > + if (info->lo_offset < 0 || info->lo_sizelimit < 0) > + return -EINVAL; > + > lo->lo_offset = info->lo_offset; > lo->lo_sizelimit = info->lo_sizelimit; I'd instead do it here: if (lo>lo_offset < 0 || lo->lo_sizelimit < 0) return -EINVAL;