linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Wool <vitaly.wool@konsulko.se>
To: Johannes Weiner <hannes@cmpxchg.org>,
	syzbot ci <syzbot+cica6a1c285444b25f@syzkaller.appspotmail.com>
Cc: a.hindborg@kernel.org, akpm@linux-foundation.org,
	alex.gaynor@gmail.com, aliceryhl@google.com,
	bjorn3_gh@protonmail.com, boqun.feng@gmail.com,
	chengming.zhou@linux.dev, dakr@kernel.org, david@redhat.com,
	gary@garyguo.net, gregkh@linuxfoundation.org,
	liam.howlett@oracle.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, lorenzo.stoakes@oracle.com,
	lossin@kernel.org, mhocko@suse.com, minchan@kernel.org,
	nphamcs@gmail.com, ojeda@kernel.org, rppt@kernel.org,
	rust-for-linux@vger.kernel.org, senozhatsky@chromium.org,
	surenb@google.com, tmgross@umich.edu, vbabka@suse.cz,
	yosry.ahmed@linux.dev, syzbot@lists.linux.dev,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot ci] Re: rust: zpool: add API for C and Rust
Date: Wed, 24 Sep 2025 07:46:13 +0200	[thread overview]
Message-ID: <aabca3ff-3cbe-468a-9b65-290d5239d987@konsulko.se> (raw)
In-Reply-To: <20250923215929.GA1122379@cmpxchg.org>



On 9/23/25 23:59, Johannes Weiner wrote:
> On Tue, Sep 23, 2025 at 09:50:10AM -0700, syzbot ci wrote:
>> syzbot ci has tested the following series
>>
>> [v6] rust: zpool: add API for C and Rust
>> https://lore.kernel.org/all/20250923102547.2545992-1-vitaly.wool@konsulko.se
>> * [PATCH v6 1/2] mm: reinstate zpool as a thin API
>> * [PATCH v6 2/2] rust: zpool: add abstraction for zpool drivers
>>
>> and found the following issues:
>> * BUG: unable to handle kernel NULL pointer dereference in zswap_store
>> * KASAN: slab-out-of-bounds Read in zpool_get_total_pages
>> * KASAN: slab-out-of-bounds Read in zswap_store
>> * KASAN: slab-use-after-free Read in zpool_get_total_pages
>> * KASAN: use-after-free Read in zpool_get_total_pages
>>
>> Full report is available here:
>> https://ci.syzbot.org/series/e8b22352-ae56-4d7c-9113-75573acf2b64
>>
>> ***
>>
>> BUG: unable to handle kernel NULL pointer dereference in zswap_store
> 
> struct zpool {
> 	void *pool;
> };
> 
> struct zpool *zpool_create_pool(const char *name) \
> { \
> 	return (struct zpool *) prefix ## _create_pool(name); \
> } \
> 
> u64 zpool_get_total_pages(struct zpool *zpool) \
> { \
> 	return prefix ## _get_total_pages(zpool->pool); \
> }
> 
> You create the zpool by simply casting the backend pool, but then you
> deref it twice as if it were an actual container for the backend pool.
> 
> I'm guessing you didn't test this even superficially?

LOL, no, forgot to run git commit --amend so came up with a wrong version.

The Rust version is correct though.

> This also still proposes an API with no in-kernel user.

That's not correct, zsmalloc is the user.

~Vitaly


  reply	other threads:[~2025-09-24  5:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 10:25 [PATCH v6 0/2] " Vitaly Wool
2025-09-23 10:26 ` [PATCH v6 1/2] mm: reinstate zpool as a thin API Vitaly Wool
2025-09-23 10:27 ` [PATCH v6 2/2] rust: zpool: add abstraction for zpool drivers Vitaly Wool
2025-09-23 21:49   ` Benno Lossin
2025-09-24  9:23     ` Vitaly Wool
2025-09-24 17:32       ` Benno Lossin
2025-09-23 16:50 ` [syzbot ci] Re: rust: zpool: add API for C and Rust syzbot ci
2025-09-23 21:59   ` Johannes Weiner
2025-09-24  5:46     ` Vitaly Wool [this message]
2025-09-24 17:38       ` Nhat Pham
2025-09-26 14:27         ` Vlastimil Babka

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=aabca3ff-3cbe-468a-9b65-290d5239d987@konsulko.se \
    --to=vitaly.wool@konsulko.se \
    --cc=a.hindborg@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=chengming.zhou@linux.dev \
    --cc=dakr@kernel.org \
    --cc=david@redhat.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lossin@kernel.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rppt@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=surenb@google.com \
    --cc=syzbot+cica6a1c285444b25f@syzkaller.appspotmail.com \
    --cc=syzbot@lists.linux.dev \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tmgross@umich.edu \
    --cc=vbabka@suse.cz \
    --cc=yosry.ahmed@linux.dev \
    /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