lists.openwall.net   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:   Thu, 3 Aug 2017 16:25:46 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Cong Wang <xiyou.wangcong@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>, "# .39.x" <stable@...nel.org>,
        Hugh Dickins <hughd@...gle.com>,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH] mm: fix list corruptions on shmem shrinklist

On Thu, Aug 3, 2017 at 4:11 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> Where is this INIT_LIST_HEAD()?

I think it's this one:

        list_del_init(&info->shrinklist);

in shmem_unused_huge_shrink().

> I'm not sure I'm understanding this.  AFAICT all the list operations to
> which you refer are synchronized under spin_lock(&sbinfo->shrinklist_lock)?

No, notice how shmem_unused_huge_shrink() does the

        list_move(&info->shrinklist, &to_remove);

and

        list_move(&info->shrinklist, &list);

to move to (two different) private lists under the shrinklist_lock,
but once it is on that private "list/to_remove" list, it is then
accessed outside the locked region.

Honestly, I don't love this situation, or the patch, but I think the
patch is likely the right thing to do.

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ