Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp26158pxb; Tue, 23 Feb 2021 16:57:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzodTAEDV4heWNmbaJpuv4zmkNr5f+//3KSJ9lepTlh+v6WPhFvyKSnSRtobuhnpi762t7N X-Received: by 2002:a17:906:4b02:: with SMTP id y2mr28662763eju.475.1614128268227; Tue, 23 Feb 2021 16:57:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614128268; cv=none; d=google.com; s=arc-20160816; b=VdLnxQZNFVqEzVhTPTKRbwYilmTBE1HQZOvm5ChFTXZDgdaxyaUr3Kb4UACEGsReNy mDRUe+U1nCvnIKBLfPx3RTk4+SipsCJ7apFnsL3ILVhWYo1EJdRMhgfnggzb75MEFInf N0btXkGv3f7RREpyTI/s9Wswc4mnAMKZ6MeBJEU/w/2EzyrWk7zZhU/B3Y3ckYyPZz2i 7HdMhYsQlqcSgrajzwfY9cCNAz8VkAf/118WsvDYcF7bAZYPQ5P4uQjfbf36r5pP26lN SQ01eRZqwvURvWC8d73KiJoOSDBLpjBa8CnxBqGDIYOqHI88ZtQjFZcAHTGTpGxNhpgG Riiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SuG9VnqKwuLIRJ6cZjNM7jYNromTYRYVFXW/gCyWCZY=; b=SKz7sPizXylLizXzBYORZslY1q5EpihE0IOimQ2CobMmmE5hmf/TT49sq1aBjahtPH GEq/nKPuXLyfjYvUw5SFLSM13W5NaOyrzIelm6Ef0WYKwsm8BnnIg5L5FbvXyXUxGXHV 7khdbmanKcpJtWPpbEO4AV8fdfi8/szS+PlN/ASE7Z5k2BjObuYaene1/OtG/hvWO88o nBxvybexD5zkk8pr7MNys9w8LokcLbR4y/LlNjCAQhMJmaZDisfamwryE2PSNmHWGHyR oYe1N2LwOMb98/DQJkDlb3TLSUdbA5Ov11zBu16fA+HvyOSTJKP+9zMXF0RDvJpcDWJ2 Nkaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o26si108567edw.74.2021.02.23.16.56.46; Tue, 23 Feb 2021 16:57:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233878AbhBWXAK (ORCPT + 99 others); Tue, 23 Feb 2021 18:00:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:49214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbhBWWqY (ORCPT ); Tue, 23 Feb 2021 17:46:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6A642AC69; Tue, 23 Feb 2021 22:45:42 +0000 (UTC) Date: Tue, 23 Feb 2021 23:45:40 +0100 From: Oscar Salvador To: Mike Kravetz Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Gerald Schaefer , Michal Hocko , Muchun Song , Heiko Carstens , Sven Schnelle , Andrew Morton Subject: Re: [PATCH] hugetlb: fix uninitialized subpool pointer Message-ID: <20210223224540.GB2740@localhost.localdomain> References: <20210223215544.313871-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210223215544.313871-1-mike.kravetz@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2021 at 01:55:44PM -0800, Mike Kravetz wrote: > Gerald Schaefer reported a panic on s390 in hugepage_subpool_put_pages() > with linux-next 5.12.0-20210222. > Call trace: > hugepage_subpool_put_pages.part.0+0x2c/0x138 > __free_huge_page+0xce/0x310 > alloc_pool_huge_page+0x102/0x120 > set_max_huge_pages+0x13e/0x350 > hugetlb_sysctl_handler_common+0xd8/0x110 > hugetlb_sysctl_handler+0x48/0x58 > proc_sys_call_handler+0x138/0x238 > new_sync_write+0x10e/0x198 > vfs_write.part.0+0x12c/0x238 > ksys_write+0x68/0xf8 > do_syscall+0x82/0xd0 > __do_syscall+0xb4/0xc8 > system_call+0x72/0x98 > > This is a result of the change which moved the hugetlb page subpool > pointer from page->private to page[1]->private. When new pages are > allocated from the buddy allocator, the private field of the head > page will be cleared, but the private field of subpages is not modified. > Therefore, old values may remain. > > Fix by initializing hugetlb page subpool pointer in prep_new_huge_page(). > > Fixes: f1280272ae4d ("hugetlb: use page.private for hugetlb specific page flags") > Reported-by: Gerald Schaefer > Signed-off-by: Mike Kravetz Do we need the hugetlb_set_page_subpool() in __free_huge_page? Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE L3