From: Johannes Weiner <hannes@cmpxchg.org>
To: 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,
vitaly.wool@konsulko.se, 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: Tue, 23 Sep 2025 17:59:29 -0400 [thread overview]
Message-ID: <20250923215929.GA1122379@cmpxchg.org> (raw)
In-Reply-To: <68d2cfc2.a70a0220.4f78.000a.GAE@google.com>
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?
This also still proposes an API with no in-kernel user.
NAK
next prev parent reply other threads:[~2025-09-23 21:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 10:25 [PATCH v6 0/2] rust: zpool: add API for C and Rust 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 [this message]
2025-09-24 5:46 ` Vitaly Wool
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=20250923215929.GA1122379@cmpxchg.org \
--to=hannes@cmpxchg.org \
--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=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=vitaly.wool@konsulko.se \
--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;
as well as URLs for NNTP newsgroup(s).