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]
Message-ID: <b725fe5d-e174-939f-1d05-8a8ca8a186fc@huawei.com>
Date:   Wed, 24 Jan 2018 15:46:27 +0800
From:   Yisheng Xie <xieyisheng1@...wei.com>
To:     Sasha Levin <Alexander.Levin@...rosoft.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
CC:     Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH AUTOSEL for 4.14 078/100] kmemleak: add scheduling point
 to kmemleak_scan()

Hi Sasha,

There is a fix patch for this patch:

  13ab183 mm/kmemleak.c: make cond_resched() rate-limiting more efficient

So if this patch is backported to stable, maybe the above patch is also
need to be backported too.

Thanks
Yisheng

On 2018/1/24 12:15, Sasha Levin wrote:
> From: Yisheng Xie <xieyisheng1@...wei.com>
> 
> [ Upstream commit bde5f6bc68db51128f875a756e9082a6c6ff7b4c ]
> 
> kmemleak_scan() will scan struct page for each node and it can be really
> large and resulting in a soft lockup.  We have seen a soft lockup when
> do scan while compile kernel:
> 
>   watchdog: BUG: soft lockup - CPU#53 stuck for 22s! [bash:10287]
>  [...]
>   Call Trace:
>    kmemleak_scan+0x21a/0x4c0
>    kmemleak_write+0x312/0x350
>    full_proxy_write+0x5a/0xa0
>    __vfs_write+0x33/0x150
>    vfs_write+0xad/0x1a0
>    SyS_write+0x52/0xc0
>    do_syscall_64+0x61/0x1a0
>    entry_SYSCALL64_slow_path+0x25/0x25
> 
> Fix this by adding cond_resched every MAX_SCAN_SIZE.
> 
> Link: http://lkml.kernel.org/r/1511439788-20099-1-git-send-email-xieyisheng1@huawei.com
> Signed-off-by: Yisheng Xie <xieyisheng1@...wei.com>
> Suggested-by: Catalin Marinas <catalin.marinas@....com>
> Acked-by: Catalin Marinas <catalin.marinas@....com>
> Cc: Michal Hocko <mhocko@...nel.org>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
> ---
>  mm/kmemleak.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index 7780cd83a495..a1ba553816eb 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -1532,6 +1532,8 @@ static void kmemleak_scan(void)
>  			if (page_count(page) == 0)
>  				continue;
>  			scan_block(page, page + 1, NULL);
> +			if (!(pfn % (MAX_SCAN_SIZE / sizeof(*page))))
> +				cond_resched();
>  		}
>  	}
>  	put_online_mems();
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ