Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5240023rdb; Wed, 13 Dec 2023 03:12:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpX+pKTOmWqk0gvwrjuPHpQmk7BX1R9PP8gNXvgpdG5TxIvujBbgMCPczuKVaeoQuyAsLe X-Received: by 2002:a17:903:112:b0:1d3:59da:56c with SMTP id y18-20020a170903011200b001d359da056cmr165953plc.49.1702465935800; Wed, 13 Dec 2023 03:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702465935; cv=none; d=google.com; s=arc-20160816; b=v2/2UpdG3qZWL4uI73vp/sMzkq0LQU3GMWxQUewZ4AntOlElZeQxuazAtfGq1IHx3g E6BKStXzLBvn7OVrORD5hlBygsld+ZrBY5fQiJCpd0S/ZwG6zbLo3U3zBe3G6pyBqwCU OmACI2Trj9V09vkEL2+i9oal5vP+Af6EJmYGW4FzkXhqpEODhTI5icZiyosfL64HPIPj /TRErVyWZUiTMTvD6pNfUFjGW+lFt/HBljVNes2lJr1nFpsOXJnYe3gP69be9o0XbWhw GMXsThBAR6tVYewRFgyWMyx3u1CReJdPDFICvAodT/qrJp4Tqe1qRJJDQqdgnYO5NorT FJwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:in-reply-to:date :mime-version; bh=NDGnVUEjGLM/KrqNZKG5GqxtRpBtkmZfbZ9eKL9zCH8=; fh=V9AeBafJgTW96HdC48wsxGAfd7Fe9P2uAL8tLCjpUN4=; b=wFZ9KVTlo5VmucgEGN3+gZmaYlWPvDPeY01ipFcRfX1tDzYjb5KXOPNbJ2jH3nDrK8 /r03WJztOxeHRd0PFbbjnyzdE15VrqDzGAIoO+0TEHJJ35VMomU/ojABZFnAUdR3eT3j BAVVBiKNQQBVaPbSSxn2kgNVHolYud5UyFB2BFyWEF5oaUCrLLK9Orj9MFLCBfBNfhDM aDy/+GOtsvsoG1XtohfrxW3qfP+1PArdscjWfKY8b/mPJQMr3V2lhN61a1emnenKc0CN tYPfjLtuEjm/LRVXfPNyKMVbx0nWDqBkjOXTTPq5Y8Pvt6AF4duuuUIjDNrttozgjhEz zRAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q16-20020a17090311d000b001d0c418175esi9264932plh.471.2023.12.13.03.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:12:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2F82C8227789; Wed, 13 Dec 2023 03:12:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378535AbjLMLL5 (ORCPT + 99 others); Wed, 13 Dec 2023 06:11:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232628AbjLMLL4 (ORCPT ); Wed, 13 Dec 2023 06:11:56 -0500 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32EC1A0 for ; Wed, 13 Dec 2023 03:12:03 -0800 (PST) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2865a614ed6so4134367a91.1 for ; Wed, 13 Dec 2023 03:12:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702465921; x=1703070721; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NDGnVUEjGLM/KrqNZKG5GqxtRpBtkmZfbZ9eKL9zCH8=; b=aLpBFf7+d/lrG7T7p/1sJgwRrqLDQdDtxdcgpxsubmHUwn5eKVnd87rLJFnuH6sihw 7H7QtLVhGe7Fj2G1o9+E5LPdgQYnQvd2BTYoJIxf8Zjg+TjYgnwvY3kxB2LUrpQ2SUVs /b93VMjxDchBpY3lpdD82OuaDlIhT0y5mWVJIICCZZLCa2XMxXE1io9nj1YhDIQNFLCO IeR5H/LO27i3qAABxJKthPkz7MUkSQS5iKR6gQDvkz9TvQGHyLYBOjcAo1h9YbqU+Sow 7Zoka5NdWhjoEc1+AQPf6FBVNNeRjXvVkMLDWZ4gUzl+CszDcGKdYtSx7eSovVQ/lGSt 98mg== X-Gm-Message-State: AOJu0YwywfWoGdArwwVtyWe76ZGAwzWVJLuYtQdVWAAcYStslsR1yW7h QJp9h58q8c8Lz5Ye4sF9jaUwHzoj/oTeW8XGYgquUMgV+ycCh/g= MIME-Version: 1.0 X-Received: by 2002:a17:902:da85:b0:1d0:bde3:25a1 with SMTP id j5-20020a170902da8500b001d0bde325a1mr114064plx.12.1702465921762; Wed, 13 Dec 2023 03:12:01 -0800 (PST) Date: Wed, 13 Dec 2023 03:12:01 -0800 In-Reply-To: <000000000000dfd6a105f71001d7@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000824aa2060c623c6f@google.com> Subject: Re: [syzbot] [syzbot] [ext4?] kernel BUG in ext4_write_inline_data From: syzbot To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.4 required=5.0 tests=FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:12:13 -0800 (PST) For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: [syzbot] [ext4?] kernel BUG in ext4_write_inline_data Author: eadavis@qq.com please test kernel BUG in ext4_write_inline_data #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 44c026a73be8 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 9a84a5f9fef4..2ab1ca192167 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -169,6 +169,7 @@ int ext4_find_inline_data_nolock(struct inode *inode) (void *)ext4_raw_inode(&is.iloc)); EXT4_I(inode)->i_inline_size = EXT4_MIN_INLINE_DATA_SIZE + le32_to_cpu(is.s.here->e_value_size); + printk("iis: %d, %s\n", EXT4_I(inode)->i_inline_size, __func__); } out: brelse(is.iloc.bh); @@ -232,7 +233,9 @@ static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc, return; BUG_ON(!EXT4_I(inode)->i_inline_off); - BUG_ON(pos + len > EXT4_I(inode)->i_inline_size); + printk("pos: %d, len: %d, iis: %d, %s\n", pos, len, EXT4_I(inode)->i_inline_size, __func__); + if (EXT4_I(inode)->i_inline_size > 0) + BUG_ON(pos + len > EXT4_I(inode)->i_inline_size); raw_inode = ext4_raw_inode(iloc); buffer += pos; @@ -314,6 +317,7 @@ static int ext4_create_inline_data(handle_t *handle, EXT4_I(inode)->i_inline_off = (u16)((void *)is.s.here - (void *)ext4_raw_inode(&is.iloc)); EXT4_I(inode)->i_inline_size = len + EXT4_MIN_INLINE_DATA_SIZE; + printk("len: %d, iis: %d, %s\n", len, EXT4_I(inode)->i_inline_size, __func__); ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS); ext4_set_inode_flag(inode, EXT4_INODE_INLINE_DATA); get_bh(is.iloc.bh); @@ -381,6 +385,7 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode, (void *)ext4_raw_inode(&is.iloc)); EXT4_I(inode)->i_inline_size = EXT4_MIN_INLINE_DATA_SIZE + le32_to_cpu(is.s.here->e_value_size); + printk("iis: %d, %s\n", EXT4_I(inode)->i_inline_size, __func__); ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); get_bh(is.iloc.bh); error = ext4_mark_iloc_dirty(handle, inode, &is.iloc); @@ -469,6 +474,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle, EXT4_I(inode)->i_inline_off = 0; EXT4_I(inode)->i_inline_size = 0; + printk("iis: %d, %s\n", EXT4_I(inode)->i_inline_size, __func__); ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); out: brelse(is.iloc.bh); @@ -1979,6 +1985,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) EXT4_I(inode)->i_inline_size = i_size < EXT4_MIN_INLINE_DATA_SIZE ? EXT4_MIN_INLINE_DATA_SIZE : i_size; + printk("isize: %d, iis: %d, %s\n", i_size, EXT4_I(inode)->i_inline_size, __func__); } out_error: