]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "mm/secretmem: use refcount_t instead of atomic_t"
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Oct 2021 19:48:33 +0000 (09:48 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Oct 2021 19:48:33 +0000 (09:48 -1000)
commita5ef35cfe27555f88a347d73d8190fc415a3e93a
tree889339bdce44c612c179d28ab9209978e85eef48
parentda7d631d00b5adcdf3998e3b280388ffd66aca1b
Revert "mm/secretmem: use refcount_t instead of atomic_t"

This reverts commit 3c936016ccee9af76bff07813842eaaebdba2850.

Converting the "secretmem_users" counter to a refcount is incorrect,
because a refcount is special in zero and can't just be incremented (but
a count of users is not, and "no users" is actually perfectly valid and
not a sign of a free'd resource).

Reported-by: syzbot+75639e6a0331cd61d3e2@syzkaller.appspotmail.com
Cc: Jordy Zomer <jordy@pwning.systems>
Cc: Kees Cook <keescook@chromium.org>,
Cc: Jordy Zomer <jordy@jordyzomer.github.io>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/secretmem.c