From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Henrique Carvalho <henrique.carvalho@suse.com>,
Steve French <smfrench@gmail.com>,
gustavoars@kernel.org, Youling Tang <tangyouling@kylinos.cn>
Cc: David Howells <dhowells@redhat.com>,
CIFS <linux-cifs@vger.kernel.org>,
Meetakshi Setiya <meetakshisetiyaoss@gmail.com>
Subject: Re: generic/013 failure to Samba
Date: Fri, 26 Dec 2025 12:36:44 +0800 [thread overview]
Message-ID: <141824e7-50ab-4072-b611-5db5fa01bb86@linux.dev> (raw)
In-Reply-To: <5frnv6uc7yvfrb4nar5rpjbjyog5krbpfvus74n2iv4vmri2s7@i5bv6napwn4o>
Hi Henrique,
I can reproduce this UBSAN error. You need to compile the kernel code
using the latest version of Clang.
I would like to give special thanks to Tang Youling
<tangyouling@kylinos.cn> for his guidance on UBSAN and Clang.
Thanks,
ChenXiaoSong <chenxiaosong@kylinos.cn>
On 12/24/25 23:02, Henrique Carvalho wrote:
> This UBSAN report is consistent with struct copychunk_ioctl_req::Chunks[]
> being annotated with __counted_by_le(ChunkCount) while ChunkCount is not
> set to the allocated capacity before we start populating the array. This is
> the same class of issue described in [1].
>
> A fix would be to set ChunkCount to chunk_count (capacity) at the start
> of each iteration before accessing Chunks[]. Proposed patch is attached.
>
> However, if my interpretation is correct, I would expect the first
> population to trip as well since ChunkCount starts at 0, which does not
> happen.
>
> @Gustavo do you have any insight into why the first access might not
> trigger?
>
> [1] https://people.kernel.org/gustavoars/how-to-use-the-new-counted_by-attribute-in-c-and-linux
>
next prev parent reply other threads:[~2025-12-26 4:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 0:19 generic/013 failure to Samba Steve French
2025-12-24 15:02 ` Henrique Carvalho
2025-12-26 4:36 ` ChenXiaoSong [this message]
2025-12-26 6:44 ` ChenXiaoSong
2025-12-26 7:49 ` ChenXiaoSong
2025-12-26 15:45 ` Henrique Carvalho
2025-12-26 16:01 ` ChenXiaoSong
2025-12-26 18:05 ` Henrique Carvalho
2025-12-26 22:48 ` ChenXiaoSong
[not found] ` <CAH2r5mtaGgiWLnMebWeGNoyVKY81xj6DkZY5iTmWkJZ_gvyeLw@mail.gmail.com>
[not found] ` <7919537a-d3b5-45cd-9032-0a5312b28dfb@linux.dev>
2025-12-26 23:46 ` ChenXiaoSong
2025-12-26 15:33 ` Henrique Carvalho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=141824e7-50ab-4072-b611-5db5fa01bb86@linux.dev \
--to=chenxiaosong.chenxiaosong@linux.dev \
--cc=dhowells@redhat.com \
--cc=gustavoars@kernel.org \
--cc=henrique.carvalho@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=meetakshisetiyaoss@gmail.com \
--cc=smfrench@gmail.com \
--cc=tangyouling@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox