All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.2 0/4] drm/buddy: backport buddy allocator fixes
@ 2026-11-18 11:38 Mirian Shilakadze
  2026-11-18 11:38 ` [Devel] [PATCH hci-8.2 1/4] ms/drm/buddy: Prevent BUG_ON by validating rounded allocation Mirian Shilakadze
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Mirian Shilakadze @ 2026-11-18 11:38 UTC (permalink / raw)
  To: khorenko; +Cc: devel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-18 15:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 11:38 [Devel] [PATCH hci-8.2 0/4] drm/buddy: backport buddy allocator fixes Mirian Shilakadze
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

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.