Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2441185rwa; Mon, 22 Aug 2022 07:47:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4VYz2fmSE51kMRP2mgRrTGMoiXdbqf9Ffty6+VD+x40QmzXpEcZYwYIM1QQeCc375kHjpT X-Received: by 2002:a05:6a00:1795:b0:536:68e0:4f5 with SMTP id s21-20020a056a00179500b0053668e004f5mr9422945pfg.42.1661179664332; Mon, 22 Aug 2022 07:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661179664; cv=none; d=google.com; s=arc-20160816; b=HMsbCR/wy4Sa/phbSb7D9CsR0wuUFFmCpQOxT0UK/ZzRjWQ6vDwdfhn4A1FtPKz0b7 vmaIUGVX/sAbWqjq3X/Zx0FwJ+TpUuRJp0ge83XuwaeRquPUCFOvuJchfF9cDQ2VTxQH s7velPE57IDt7yyOmSoCHZC3DMZyDfoDo4C1rnCUgeQ/3VgJ4O5/pk9yrA5Bdgex2FlW 3BePfJX2B/rkp7UqmOMNydhLgFuhkP8bu7os8Fc1MQ8KrKQzDA8kiobZJ6Yl9A+6VzDB lUgKV70H07afQY8cgwp0qdakSQiE4IWgew3oB2X1sjivx3xGneEhH7OHe/aDAJ6PmbHJ nw0A== 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=x9nBUo0+hZpdGfurRQeuyioQwpYpr7z6L1SJHhD4mc0=; b=JBACGtqjmRGbrUEYmo+x5Tl/F17Tl8z/5dbBgYHlmRQwk1Mm9iE3/GJFqGz1IbFoi0 c5p08DWaV0Ts4+V8W8W0kNVsPGmTs8eSi0FoGk7ybKdy7zHM5jasZXTfBZff0InQGQdW glTbeLE1R9GU6Q9PuWMMK+j+v0u16/BeOY30ge36PnnrEqINUI0YBPQCxJ9P9P9Oaa4r zWuUznxoMi6y6UDeer7kk7jbONauFPV4/2+tjdC/cCDLb83sdgGz6R6aZQFayive71X8 oXcyCc5TlLr2W8s3X5G+hW+w0ApjdPAbXqR2qhUlUtUme9A/zBzBAJ7A96BdsffzW/ZC AKEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="srfxE/Q6"; 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 t4-20020a17090ad14400b001f538744941si12388020pjw.34.2022.08.22.07.47.24; Mon, 22 Aug 2022 07:47:44 -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="srfxE/Q6"; 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 S235487AbiHVOqS (ORCPT + 99 others); Mon, 22 Aug 2022 10:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235647AbiHVOpl (ORCPT ); Mon, 22 Aug 2022 10:45:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97882248C2; Mon, 22 Aug 2022 07:45:40 -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=x9nBUo0+hZpdGfurRQeuyioQwpYpr7z6L1SJHhD4mc0=; b=srfxE/Q6nHF+9wd/VdS0IGeBqk kf2royYp/fC6OyojYMvfqw8KVCd2y2ud1/MytJk1LfII+B1JXMgEsLbOtJAH2Qx7kdmcwytRDwhad 5DaqW4FqdAmCuqWK4x7aEb7eCfZn2Ki9VSP2o9lgDZ9M92V9cdJx5ySmGrnI5VjRZ/3eE7/Gx4Uq5 9BPikQCIB35OtKoIZvkJdpjcsQifNaRqMycBMQ5BDX4IfY+YW28krSeF/amGzTnMuKHBs2+o++7gI pyBoej4IqhLuCmY/8HwCEkgp0G6MtY5GaTyCsz4Lh4jwWQWFocaZPJnLT+EMuLxxzewm1fNg8LYtq 4kRO/eSQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQ8gD-00EMmb-0K; Mon, 22 Aug 2022 14:45:29 +0000 Date: Mon, 22 Aug 2022 15:45:28 +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: <182c028abf0.2dc6f7c973088.2963173753499991828@siddh.me> <20220821114816.24193-1-code@siddh.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220821114816.24193-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 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 Sun, Aug 21, 2022 at 05:18:16PM +0530, Siddh Raman Pant wrote: > @@ -979,9 +979,15 @@ loop_set_status_from_info(struct loop_device *lo, > > lo->lo_offset = info->lo_offset; > lo->lo_sizelimit = info->lo_sizelimit; > + lo->lo_flags = info->lo_flags; > + > + /* loff_t/int vars are assigned __u64/__u32 vars (respectively) */ > + if (lo->lo_offset < 0 || lo->lo_sizelimit < 0 || lo->lo_flags < 0) > + return -EOVERFLOW; Why would you check lo_flags? That really, really should be an unsigned type.