From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 76D4839F195 for ; Wed, 22 Apr 2026 11:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776858691; cv=none; b=VkPTdEEBCtAOEixqssiPVW5QW+jjOb4waZFpjqs0GYra/bueeZQ/DVKVqnlRNR0pdhcJBk/llbQhXLBWp6BTYOX78Wz2VHjcXSV9AnfyjuyPCsr45ZXRmFZw0YaABdljeNtW1haIYMXDOoqjwHG+jPtH6DX4XGbcPukMAT0Em/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776858691; c=relaxed/simple; bh=OBn4CvTQ5YASqiiH9xDH515EARre704jAVVy/mGT2hM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OOgqtjQUkE5Au6WuMjWEQTJswZThVDHvn8CFo+84ihftksit31kRb8f9x1XHScamBH7eoVXAY9lvr0I1DTkReFxf5+RrPu82ZcJpQlMjX9Fli6GTOUZnxVPzDiLzK/UtFgUum/+ASFkrTUs8SRii46cNFcqhJtTo52Rs7KMbHHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=B7YfJo5T; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="B7YfJo5T" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so42747585e9.2 for ; Wed, 22 Apr 2026 04:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776858688; x=1777463488; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=76R9SIp6a0TMGxYcT3ORY3Bh14TIu6L0Ph33OjuxO2A=; b=B7YfJo5TKSMSRvik8uE1DUBka4t4RCxSp2q4qLIBf9pUM+fGFt5O5cFIdCZMbwybCB JjZbabTnFPOY6SUogDqHoVFj8J4eMMqf+x0pJixXiFcThe5VWL9Ruo3hivtjaF3mQAQZ Nq21sD6Y7oIX+ZGZsAU7+i5xJjOGVHcEjVjbV16ZlDeCvmHXTYBLcnpiVILWWwC4zoHZ 8vIcesE/1BKsDeyZO8d9xF8pmknbLngxJKlxEk+zEAYiFVi0N38YfE0nxLt/y+Pz0Y94 /8g4qtbqw+ojSR5JQ+g2z14CJeSe73YL2xGNfUxGjMUEd7MXCGQP3UjWCmQA3Cs5w6Oi RZ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776858688; x=1777463488; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=76R9SIp6a0TMGxYcT3ORY3Bh14TIu6L0Ph33OjuxO2A=; b=cHzrcIvI7/onnIVnSvN4qNAJPOz5aXPKeOLJiIHAhcqHD9z8sbDzuKJx5t3xoosF9V UrwUcTintaAVYd9Z84xVGioeK5i5KcTKWaI6BB8pzXMo4UDN9VvAqfZ0RlJo6k16WlC/ 1hi7R78Z9D297JrAfEGSkwSa5j24mTycoeLpCte6rvqY4Zha4FiKcZKoSbdgT4uLupFA dRgArAi5omk+qGnv5hGoO6k6ZdSD8QSYHGWxPKRE8p58J7Hdsdq4b4RLA5WUcdi8Wj12 Rzryjc+G1Xo+Hm/zIIcKH0UcUz8hnQPb6POGAjdX3xyawE7kLaACcDM00vU8AI7g3r9K SGgw== X-Forwarded-Encrypted: i=1; AFNElJ9ec8jfnn3VpEmmZRz1VKkPv37Kvq37ihWe5BMQBVrt3XzoeVNYuVxMRqYixPFu2mLTeLqyLDOdWjD4MP0=@vger.kernel.org X-Gm-Message-State: AOJu0YwlP7lLEj4kvYUaUGesKkOpxA+bQ2DYFFMmStZtHnnkH+xME7aF LpQORcViTl1NAOwjiCR5VS+KDVK8Ne2/G9xfGH74Eqe3YwJxJoBSpXb4EeUl9uNwKg== X-Gm-Gg: AeBDietdQQC3kHIyU6MmjKn2aPmR9cREW0FKgSUbhS6gELU1fE9TPKNla27vcTTqWGp rF10k8Ot36+aMYu4f0DBD4AU4ci9qGkXP8YtLwX1j4hRCy62um6FV6OIwOqI9A+dbwTXizR9LQH HH1BO43RK7CbntfrCdRlvIo+Zo7QaKR/0yIgvIRPmvgBPD2vOFo+v577FbQeZj9n81mZSrKaGMb B1jR9pHFpLNcsclbUypBE4RgXGylyeSG4JYR1XjE+0CiWjp0I5rM/6B3KKzxhwJBM3/oVHdyWn6 8H5DV/oghbsj30oImSwD8qEn0Yr9qyH8zEitwnScUTHd8xMMpjtYutE9UEOCs+lVHKIwusLdlQM rwgcJdqP7MbXV1yEzaHCRFPkD6sOKIjw+lTX927O454vtvY/a5exUvkCBD27GzNvc8+pCzZWt79 nXJuGC/bK3ImEVqHXnNzgUZqZOLF7/5kY+AOsg/DYps0t1u4Ewj4WQKKZnKcidcVLEycSS7iLwY xf2pCOw9g== X-Received: by 2002:a05:600c:5295:b0:486:f634:ef1 with SMTP id 5b1f17b1804b1-488fb77d0fdmr311256245e9.17.1776858687442; Wed, 22 Apr 2026 04:51:27 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:2834:9:5934:909d:d13c:e075]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a55b8baaesm189558445e9.10.2026.04.22.04.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 04:51:26 -0700 (PDT) Date: Wed, 22 Apr 2026 13:51:20 +0200 From: Marco Elver To: Arnd Bergmann Cc: Konstantin Komarov , Dmitry Vyukov , ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Subject: Re: kcsan -Wmaybe-uninitialized warning in ntfs3 Message-ID: References: <0df31031-23d4-49cf-8643-f605561bf7fb@app.fastmail.com> <6eac698f-da35-4efc-b227-b54de5d1decb@app.fastmail.com> <49780769-461a-4a09-a7df-c34a2e839e45@app.fastmail.com> <4b36f629-9338-40e0-b114-ee37aaad9cf3@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.13 (2024-03-09) On Wed, Apr 22, 2026 at 01:35PM +0200, Marco Elver wrote: > On Wed, 22 Apr 2026 at 10:23, Marco Elver wrote: > > > > On Wed, 22 Apr 2026 at 10:00, Arnd Bergmann wrote: > > > > > > On Tue, Apr 21, 2026, at 21:12, Arnd Bergmann wrote: > > > > On Tue, Apr 21, 2026, at 21:06, Marco Elver wrote: > > > >> On Tue, 21 Apr 2026 at 17:26, Marco Elver wrote: > > > >> [...] > > > >>> > To me, 2 makes more sense. The attribute requires gcc-11 or higher, > > > >>> > so you need to wrap that in a compiler version specific macro, > > > >>> > but since I only saw the warning with gcc-12 and higher, that > > > >>> > should be fine. > > > >> > > > >> Kindly test if you can: > > > >> https://lore.kernel.org/all/20260421190351.1976329-1-elver@google.com/ > > > > > > > > Applied to my randconfig tree and verified that this fixes the > > > > known warning (only one out of about 200 random configs). I'll > > > > let you know if something comes up by tomorrow. > > > > > > Unfortunately, there are new warnings after your patches using > > > gcc-11. In 500 randconfig builds with that compiler, I saw 7 > > > configurations failing with one of these four messages: > > > > Looks like a compiler bug to me; can you check gcc-12+ ? Maybe we need > > to allow the __access attribute only for later GCC versions. > > I can also see this warning with later GCC - so I'll give up on the > __attribute__((access)) version and instead suppress warnings. The simplest solution I found so far: diff --git a/include/linux/kcsan-checks.h b/include/linux/kcsan-checks.h index 92f3843d9ebb..989fd21841ba 100644 --- a/include/linux/kcsan-checks.h +++ b/include/linux/kcsan-checks.h @@ -282,7 +282,7 @@ static inline void __kcsan_disable_current(void) { } * @size: size of access */ #define __kcsan_check_write(ptr, size) \ - __kcsan_check_access(ptr, size, KCSAN_ACCESS_WRITE) + __kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_WRITE) /** * __kcsan_check_read_write - check regular read-write access for races @@ -291,7 +291,7 @@ static inline void __kcsan_disable_current(void) { } * @size: size of access */ #define __kcsan_check_read_write(ptr, size) \ - __kcsan_check_access(ptr, size, KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE) + __kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE) /** * kcsan_check_read - check regular read access for races @@ -308,7 +308,7 @@ static inline void __kcsan_disable_current(void) { } * @size: size of access */ #define kcsan_check_write(ptr, size) \ - kcsan_check_access(ptr, size, KCSAN_ACCESS_WRITE) + kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_WRITE) /** * kcsan_check_read_write - check regular read-write access for races @@ -317,7 +317,7 @@ static inline void __kcsan_disable_current(void) { } * @size: size of access */ #define kcsan_check_read_write(ptr, size) \ - kcsan_check_access(ptr, size, KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE) + kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE) /* * Check for atomic accesses: if atomic accesses are not ignored, this simply @@ -331,9 +331,9 @@ static inline void __kcsan_disable_current(void) { } #define kcsan_check_atomic_read(ptr, size) \ kcsan_check_access(ptr, size, KCSAN_ACCESS_ATOMIC) #define kcsan_check_atomic_write(ptr, size) \ - kcsan_check_access(ptr, size, KCSAN_ACCESS_ATOMIC | KCSAN_ACCESS_WRITE) + kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_ATOMIC | KCSAN_ACCESS_WRITE) #define kcsan_check_atomic_read_write(ptr, size) \ - kcsan_check_access(ptr, size, KCSAN_ACCESS_ATOMIC | KCSAN_ACCESS_WRITE | KCSAN_ACCESS_COMPOUND) + kcsan_check_access(absolute_pointer(ptr), size, KCSAN_ACCESS_ATOMIC | KCSAN_ACCESS_WRITE | KCSAN_ACCESS_COMPOUND) #endif /**