Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slub: Bug on free of non-slab objects
Before commit d0fe47c ("slub: add back check for free nonslab objects"), freeing a non-slab object used to trigger a BUG if CONFIG_DEBUG_VM was enabled. Now it only warns, which I think is not enough for such a memory corruption. Let's restore the previous behaviour, but tie it to CONFIG_BUG_ON_DATA_CORRUPTION as suggested by Levente. After page folios were introduced in v5.17, this patch was adapted to trigger a bug when the order of the folio is zero instead of when the page is not a compound page, which is not equivalent but respects the semantics of the conversion to page folios and follows the change made to the WARN_ON_ONCE beneath. Suggested-by: Levente Polyak <levente@leventepolyak.net> Signed-off-by: Thibaut Sautereau <thibaut.sautereau@ssi.gouv.fr>
- Loading branch information