All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 0/4] drm/buddy: backport buddy allocator fixes
Date: Wed, 18 Nov 2026 15:38:09 +0400	[thread overview]
Message-ID: <20261118113935.381228-1-mirian.shilakadze@virtuozzo.com> (raw)

Item 1 from the review of VSTOR-154850 v1. Upstream fixes for the buddy
allocator code that came with the RHEL import:

1. 5488a29596cd: a rounded up allocation larger than the memory size
   hits BUG_ON(order > mm->max_order).
2. 0251963afd22: a failed split_block() leaves a freed block in the free
   tree (use-after-free).
3. 56bc6384314f: the contiguous fallback can return a start that ignores
   min_block_size.
4. fb26cf4f1df4: when the contiguous fallback fails or retries, it
   frees the whole list the caller passed in, including blocks the
   caller allocated before. Not in the ticket and not in mainline yet
   (linux-next, Cc stable). Taken because it fixes the same fallback as
   3 and the drm_buddy suite catches it: without 4, alloc_contiguous
   fails on the check that 4 adds.

Patches 2 to 4 are adapted to the drm_buddy names. 264.x already has 1
from RHEL, and 2 to 4 apply to it as is.

Tested with KUnit on the 211.75.1.26.2 debug kernel (KASAN, failslab),
stock and patched drm_buddy.ko built from this tree:
- drm_buddy suite with the test from 4: stock and 1-3 fail only
  alloc_contiguous, on the check that 4 adds. 1-4 pass.
- dc0e3aa54eaa, the mainline test for 1: stock hits the BUG_ON, patched
  passes.
- try_harder alignment (own test): stock returns 12K at 8K for a 16K
  min_block_size, patched returns -ENOSPC.
- split_block() failing in alloc_from_freetree(), __alloc_range() and
  __alloc_range_bias() via failslab (own test): stock gives KASAN
  slab-use-after-free and then the BUG_ON in alloc_from_freetree(),
  patched passes at every injection point.
- ve selftests: the same with stock and patched drm_buddy.ko
  (ve_ns_owner_test and ve_vtty_stress fail on both).

https://virtuozzo.atlassian.net/browse/VSTOR-155318

Arunpravin Paneer Selvam (1):
  ms/gpu/buddy: bail out of try_harder when alignment cannot be honoured

Francois Dugast (1):
  ms/gpu/buddy: Fix use-after-free in split_block() call sites

Matthew Auld (1):
  ms/gpu/buddy: do not pass caller list to __alloc_contig_try_harder()

Sanjay Yadav (1):
  ms/drm/buddy: Prevent BUG_ON by validating rounded allocation

 drivers/gpu/drm/drm_buddy.c            | 107 ++++++++++++++++++-------
 drivers/gpu/drm/tests/drm_buddy_test.c |   9 +++
 2 files changed, 89 insertions(+), 27 deletions(-)

-- 
2.47.3

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-11-18 11:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 11:38 Mirian Shilakadze [this message]
2026-11-18 11:38 ` [Devel] [PATCH hci-8.2 1/4] ms/drm/buddy: Prevent BUG_ON by validating rounded allocation Mirian Shilakadze
2026-11-18 11:43   ` no-reply
2026-11-18 11:38 ` [Devel] [PATCH hci-8.2 2/4] ms/gpu/buddy: Fix use-after-free in split_block() call sites Mirian Shilakadze
2026-11-18 11:43   ` no-reply
2026-11-18 11:38 ` [Devel] [PATCH hci-8.2 3/4] ms/gpu/buddy: bail out of try_harder when alignment cannot be honoured Mirian Shilakadze
2026-11-18 11:47   ` no-reply
2026-11-18 11:38 ` [Devel] [PATCH hci-8.2 4/4] ms/gpu/buddy: do not pass caller list to __alloc_contig_try_harder() Mirian Shilakadze
2026-11-18 11:45   ` no-reply
2026-11-18 15:37 ` [Devel] [PATCH hci-8.2 0/4] drm/buddy: backport buddy allocator fixes Konstantin Khorenko
2026-11-18 15:37 ` 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=20261118113935.381228-1-mirian.shilakadze@virtuozzo.com \
    --to=mirian.shilakadze@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.