From: Alexey Kuznetsov <kuznet@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: azaitsev@virtuozzo.com, kui.liu@virtuozzo.com, devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1] fs/fuse/kio: do not panic on unaligned memory access in cs accel
Date: Tue, 1 Dec 2026 02:12:47 +0800 [thread overview]
Message-ID: <CAMrnHh40sb9HNXhkx0FGrGc+nXjSAjju_EuzPo62nn7QWJoK0g@mail.gmail.com> (raw)
In-Reply-To: <179605457779.1088513.3574270513428350209.b4-review@b4>
Acknowledged.
It is for 8.1 as marked in the subject, and of course of 8.2.
Actually all the versions are affected, but I would not care,
it is still marginal. But because such simple and fatal bug
has been found in testing 8.1 I guess it would be better
to fix it at least starting from there.
> Not only tmpfs
Sure. There are lots of bizarre configurations.
F.e. csd could be started even on top on vstorage itself. :-)
Meatbags are more stupid than Claude but still have a common
sense which saves a lot of time and have to protect themselves
of redundant anality. tmpfs is special in sense it is really used in tests.
Anyway, in production it would be not so bad to reject initialization cs accel
requests unless it is ext4 with options used in real life i.e. ordered metadata
journal, no fast commits, no crypto. Acttually, it is not about kernel part,
user space will corrupt itself unless it is ext4 with exactly these properties.
It is safe but inconvenient, we will have to add knobs to override this
for tests.
> The error then goes through map_notify_soft_error() and closes the
congestion window of the local CS
It should not. It was supposed to be intercepted in map_read_error()
and ignored w/o harming any state. But everything is possible,
I will check.
> csa_submit() leaks the crc_page
This sounds really serious! If this is true, it is a bug
much worse than even oops. "AIO submit rejected" path is not exotic
and if it leaks it is fatal.
On Tue, Dec 1, 2026 at 12:11 AM Konstantin Khorenko
<khorenko@virtuozzo.com> wrote:
>
> Please, send an ACK for the patch and after that
>
> i can apply this with the following fixes on my side:
>
> - trailers: dropped "Affects:" (it repeats the URL) and the blank
> lines between them, put them in the usual order: URL, Fixes,
> Feature, Signed-off-by. With the blank lines git saw only Feature:
> as a trailer.
>
> On Mon, 30 Nov 2026 22:57:17 +0800, Alexey Kuznetsov wrote:
> > Nevertheless,
> > new kernels have allowed O_DIRECT access to tmpfs
> > (e88e0d366f9c "tmpfs: trivial support for direct IO"), which does
> > not imply any memory alignment constraints. Our tests really use
> > tmpfs.
>
> Not only tmpfs. On ext4/xfs CS disks an O_DIRECT read of a hole or
> an unwritten extent goes through iomap_dio_hole_iter(), which fills
> the buffer without the memory alignment check of the bio path, and
> ext4 data=journal falls back to buffered reads. So the BUG_ON could
> fire in production before the tmpfs change, and the fix is worth
> having on every branch with 5acc64b761cd.
>
> > - vstorage deliberately does not check memory alignment anywhere.
>
> init_crypted_data() does check it, (bv_offset | bv_len) & 511, before
> the encrypted write is submitted.
>
> > + if (unlikely(len & 511)) {
> > + put_page(page);
>
> No change needed now, a thought for later: this fires only after the
> local read is done and the earlier pages are decrypted in place.
> The error then goes through map_notify_soft_error() and closes the
> congestion window of the local CS (eff_cwnd = 1) until its next
> success. The same check in csa_submit() for IREQ_F_CRYPT, as on the
> write path, would fall back before any IO and without that.
>
> Separate patches, not needed for this one. I created a task:
>
> 1. csa_submit() leaks the crc_page[] references taken by
> quick_crc_fetch() on its synchronous error returns ("Not a bvec",
> "AIO submit rejected"); the caller falls back to the network and
> the union with iochunk.ir overwrites the pointers. Unaligned
> O_DIRECT reads on block-backed CS storage with CRC take this path.
> https://virtuozzo.atlassian.net/browse/VSTOR-158112
>
> --
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-30 18:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 14:57 Alexey Kuznetsov
2026-11-30 16:02 ` Konstantin Khorenko
2026-11-30 18:12 ` Alexey Kuznetsov [this message]
2026-11-30 16:04 ` Konstantin Khorenko
2026-12-01 1:06 ` no-reply
2026-12-01 12:13 ` Konstantin Khorenko
2026-12-01 12:30 ` Konstantin Khorenko
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=CAMrnHh40sb9HNXhkx0FGrGc+nXjSAjju_EuzPo62nn7QWJoK0g@mail.gmail.com \
--to=kuznet@virtuozzo.com \
--cc=azaitsev@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=kui.liu@virtuozzo.com \
/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