From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D0001D63D1 for ; Thu, 19 Dec 2024 23:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734651202; cv=none; b=C/ggn93Se5VFl59lykOnq+9+a+b0VhYsxYVQZ2gUGnQ5SRdHl3D+cvhIUXDJ9YV6HHEbrOgais9sBaYF8yp5h1Xwu7NVi61bvowzLhKgTA7aFLbVVFOJhZb/no0TZCg6mHvuQKGGU6J+3DJ0rB3HlFWw+7KvSscxxbPusr26EsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734651202; c=relaxed/simple; bh=IGUlTiZB+8SYnvIyjl7ycth1V8p6AFVwQwmiellDTDA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MvesChsxPgeqMoc8SlslKPZwMOebqxdRSnL779dgyAtNYK4Rv+e8mgvsHpkBnRtnz1B6MqXxAp0gcEcg7ByzRQisMJhoTS/19Vcq3zPnEhBoZPIatgKzL1qHdVYf90P9JEqgiZebmGvUzjXLZtXEYRLnPPCaTsPhHGCibfD8A98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Err+w9XA; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Err+w9XA" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3863c36a731so1020531f8f.1 for ; Thu, 19 Dec 2024 15:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1734651196; x=1735255996; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=plXzy0mqccglcjN60lQtMmRi6JM3/4v7bNfZ+B+BCEo=; b=Err+w9XAJrRshT+9EMZ54cYI6Wp6gCUpdFiFrOkIOdYNCZ8lLmxZ3h/p22uBxK/eSK 5OnApN7LzXRUBe1YgexRGll0JKThV1pXVE0C+Sowu8NVANpRSSzl3TAv0P4D30Qun/Au 9D3FnlqMbAeLWnIglT3WwPmTeJhlzicOMjOvuu8IxYSzLrT6+n9sacdfRo67vqghici9 owJ7pXQNixo9IOmm+H4HVdOx5flecfbS2/L0QhgijnX4RKV/Rm7CJ3FPgMLcRSTW7yoM 1/JgYKkNIqqAJboVjYZeEwyOH7CKi3b0ZAAQy+lCMKWvwCtM4CDCcCLT0V4GVjVhZMix jhqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734651196; x=1735255996; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=plXzy0mqccglcjN60lQtMmRi6JM3/4v7bNfZ+B+BCEo=; b=VJwUPhanTOFRhQgk/PJgnGl3gHoGxNdC5wb0cX3W9XhpUXsBpAdt+19JuqwCVCls3T pBUvUBQ7TMGeJjpKiFszbxVTonl2Mdsso9QaGOE3oawA2I4n59OA2u8w5psZiDLHkAUM qPRhOtlcnwhPSixcKhlTi0tEBI/g9H5QuMtTMliGznpOl/hEBAAepe41hO7khMLG2Sfa gmQZ3f+VE5/H6LDujkHgm0+pdPH3v/Q+7av1ErvmRfRljsvohDZTIKiJj8yh3alHGsd6 vq9pvmBeE4PLt4XWqUsjZHNMdtOiDKetit18OOsToG9xRbpq/tYFw7Dkc4Wu5IYEqX8p K/Zg== X-Forwarded-Encrypted: i=1; AJvYcCX/q7Psf8pMYHKdCKhJxfbHOSMlfi/DX+KDYUFX97RW82O/AjK1ZpblnLRLEmGrOsa28OL+jlVIKq1p@vger.kernel.org X-Gm-Message-State: AOJu0YzWc7wzpUITVRzTx3yjmvaw4TaY4eRZfA5UxxPJHlWHWhgAtn6M uuxCst1cksq/u2ECN2htdKMGBxEOf9G9+LcOJWBUitST50YsSvaNTUE0gv/TeyM= X-Gm-Gg: ASbGncsWeq3Dn1GRGg2mquDNu+4w1A+O6fWFn1+usKLDwvLMZeXdxuBnHHd+A4rlNJ6 caPiDuRC7rkXqounDir1VOAvHNtjWSfxmTpWGNsRWNC0G+LiqL9xq76LfNE+YFk2Udd76zaxohm mAy57H/LM8Rvyd+LchtY6TGs63V0ePanvmato83Avi+uEDi9wXFPMmlZRnepaV4Zokko2Qm+4m5 Er0qRkckXNcYAt/l5Sgj0aX6OhspIi1TtcvonyGdl+CVTo/XFUJ5HjDmrVtAbRhVq7zR5nCY9j6 iPgupJfw X-Google-Smtp-Source: AGHT+IF6jsLKrygiCsaqg3pCcyY8MzhIQvO7tqSo5RX2vJWoS0uQZfdMN1myWFcxAw/3ExiSRCwNfw== X-Received: by 2002:a5d:5e09:0:b0:385:f16d:48b4 with SMTP id ffacd0b85a97d-38a223f7510mr934878f8f.40.1734651196065; Thu, 19 Dec 2024 15:33:16 -0800 (PST) Received: from ?IPV6:2403:580d:fda1::299? (2403-580d-fda1--299.ip6.aussiebb.net. [2403:580d:fda1::299]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8162d0sm1883546b3a.12.2024.12.19.15.33.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Dec 2024 15:33:15 -0800 (PST) Message-ID: <023311e6-9666-4fe0-9c22-6a8409065539@suse.com> Date: Fri, 20 Dec 2024 10:03:08 +1030 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: qemu-arm64: CONFIG_ARM64_64K_PAGES=y kernel crash on qemu-arm64 with Linux next-20241210 and above To: Dan Carpenter , Qu Wenruo Cc: Naresh Kamboju , qemu-devel@nongnu.org, open list , Linux Regressions , linux-ext4 , lkft-triage@lists.linaro.org, linux-mm , Linux btrfs , =?UTF-8?Q?Alex_Benn=C3=A9e?= , Anders Roxell , Arnd Bergmann , David Sterba References: <0c46224b-ed2b-4c8e-aa96-d8f657f59b9f@stanley.mountain> Content-Language: en-US From: Qu Wenruo Autocrypt: addr=wqu@suse.com; keydata= xsBNBFnVga8BCACyhFP3ExcTIuB73jDIBA/vSoYcTyysFQzPvez64TUSCv1SgXEByR7fju3o 8RfaWuHCnkkea5luuTZMqfgTXrun2dqNVYDNOV6RIVrc4YuG20yhC1epnV55fJCThqij0MRL 1NxPKXIlEdHvN0Kov3CtWA+R1iNN0RCeVun7rmOrrjBK573aWC5sgP7YsBOLK79H3tmUtz6b 9Imuj0ZyEsa76Xg9PX9Hn2myKj1hfWGS+5og9Va4hrwQC8ipjXik6NKR5GDV+hOZkktU81G5 gkQtGB9jOAYRs86QG/b7PtIlbd3+pppT0gaS+wvwMs8cuNG+Pu6KO1oC4jgdseFLu7NpABEB AAHNGFF1IFdlbnJ1byA8d3F1QHN1c2UuY29tPsLAlAQTAQgAPgIbAwULCQgHAgYVCAkKCwIE FgIDAQIeAQIXgBYhBC3fcuWlpVuonapC4cI9kfOhJf6oBQJnEXVgBQkQ/lqxAAoJEMI9kfOh Jf6o+jIH/2KhFmyOw4XWAYbnnijuYqb/obGae8HhcJO2KIGcxbsinK+KQFTSZnk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224b-ed2b-4c8e-aa96-d8f657f59b9f@stanley.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2024/12/20 02:07, Dan Carpenter 写道: > On Thu, Dec 19, 2024 at 06:10:56PM +0300, Dan Carpenter wrote: >>>> Mind to test it with KASAN enabled? >>> >> >> Anders is going to try that later and report back. >> > > Anders ran it and emailed me. I was going to tell him to respond to > the thread but I decided to steal the credit. #GreatArtists > > BTRFS info (device loop0): using crc32c (crc32c-arm64) checksum algorithm > ================================================================== > BUG: KASAN: slab-out-of-bounds in __bitmap_set+0xf8/0x100 > Read of size 8 at addr fff0000020e4a3c8 by task chdir01/479 > > CPU: 1 UID: 0 PID: 479 Comm: chdir01 Not tainted 6.13.0-rc3-next-20241218 #1 > Hardware name: linux,dummy-virt (DT) > Call trace: > show_stack+0x20/0x38 (C) > dump_stack_lvl+0x8c/0xd0 > print_report+0x118/0x5e0 > kasan_report+0xb4/0x100 > __asan_report_load8_noabort+0x20/0x30 > __bitmap_set+0xf8/0x100 > btrfs_subpage_set_uptodate+0xd8/0x1d0 [btrfs] > set_extent_buffer_uptodate+0x1ac/0x288 [btrfs] > __alloc_dummy_extent_buffer+0x2cc/0x488 [btrfs] Thanks a lot. The problem is still inside the dummy extent buffer allocation. This time it's again related to the uninitialized fs_info->* variables. In this case, it's the fs_info->sectorsize_bits which is not initialized, thus its default value is 0. Then in btrfs_subpage_set_uptodate(), we use (len >> sectorsize_bits) to calculate how many bits must be set. But since sectorsize_bits is 0, the @len (4K) is utilized, resulting the out-of-boundary access. The root cause is the same as the initial failure, that we can not use a lot of functions to do such early verification, thus I'll create a dedicated helper to do the sanity check to avoid memory allocation nor early access to fs_info. Thanks everyone involved in exposing this bug! Qu > alloc_dummy_extent_buffer+0x4c/0x78 [btrfs] > btrfs_check_system_chunk_array+0x30/0x308 [btrfs] > btrfs_validate_super+0x7e8/0xd40 [btrfs] > open_ctree+0x958/0x3c98 [btrfs] > btrfs_get_tree+0xce4/0x13d8 [btrfs] > vfs_get_tree+0x7c/0x290 > fc_mount+0x20/0xa8 > btrfs_get_tree+0x72c/0x13d8 [btrfs] > vfs_get_tree+0x7c/0x290 > path_mount+0x748/0x1518 > __arm64_sys_mount+0x234/0x4f8 > invoke_syscall.constprop.0+0x78/0x1f0 > do_el0_svc+0xcc/0x1d8 > el0_svc+0x38/0xa8 > el0t_64_sync_handler+0x10c/0x138 > el0t_64_sync+0x198/0x1a0 > > Here are the full logs. > https://people.linaro.org/~anders.roxell/next-20241218-issue-arm64-64k+kasan/ > > regards, > dan carpenter