Thread (38 messages) 38 messages, 6 authors, 2021-11-01

Re: [RFC 1/8] mm: add overflow and underflow checks for page->_refcount

From: Muchun Song <hidden>
Date: 2021-10-27 07:47:25
Also in: linux-m68k, lkml

On Wed, Oct 27, 2021 at 1:38 AM Pasha Tatashin
[off-list ref] wrote:
The problems with page->_refcount are hard to debug, because usually
when they are detected, the damage has occurred a long time ago. Yet,
the problems with invalid page refcount may be catastrophic and lead to
memory corruptions.

Reduce the scope of when the _refcount problems manifest themselves by
adding checks for underflows and overflows into functions that modify
_refcount.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
I found some atomic_add/dec are replaced with atomic_add/dec_return,
those helpers with return value imply a full memory barrier around it, but
others without return value do not. Do you have any numbers to show
the impact? Maybe atomic_add/dec_return_relaxed can help this.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help