lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 24 Oct 2021 09:54:22 -1000
From:   Linus Torvalds <>
To:     syzbot <>
Cc:     Andrew Morton <>,,,
        Linux Kernel Mailing List <>,
        Linux-MM <>,
        syzkaller-bugs <>
Subject: Re: [syzbot] WARNING: refcount bug in memfd_secret

On Sat, Oct 23, 2021 at 9:35 AM syzbot
<> wrote:
> syzbot found the following issue on:
> HEAD commit:    9c0c4d24ac00 Merge tag 'block-5.15-2021-10-22' of git://gi..
> git tree:       upstream
> console output:
> kernel config:
> dashboard link:
> compiler:       Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro:
> C reproducer:
> The issue was bisected to:
> commit 110860541f443f950c1274f217a1a3e298670a33

I think that commit is actually just buggy.

"secretmem_users" is not actually a reference count. There's no "magic
happens when it goes down to zero".

It's purely a count of the number of existing users, and incrementing
it from zero is not a probolem at all - it is in fact expected.

Sure, zero means "we can hibernate", so zero and overflow are somewhat
special, but not special enough to cause these kinds of issues.

I have reverted this commit in my tree, because honestly, the whole
"try to overflow exactly, and hibernate" threat model just isn't worth
this all.

If people really care, I can suggest

 - use "atomic_long_t" instead. Let's face it, 32-bit isn't
interesting any more, and 64-bit doesn't overflow.

 - make up some new "atomic_inc_nooverflow()" thing or whatever.

but for now this is just reverted.


Powered by blists - more mailing lists