From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1418EC43464 for ; Fri, 18 Sep 2020 02:10:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B0955221EC for ; Fri, 18 Sep 2020 02:10:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JDq9hmOT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0955221EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44DCD6B0098; Thu, 17 Sep 2020 22:10:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FF216B0099; Thu, 17 Sep 2020 22:10:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 313696B009A; Thu, 17 Sep 2020 22:10:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 1ADAA6B0098 for ; Thu, 17 Sep 2020 22:10:55 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DD971824999B for ; Fri, 18 Sep 2020 02:10:54 +0000 (UTC) X-FDA: 77274554028.30.alley41_041268927127 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id BD1B1180B3AA7 for ; Fri, 18 Sep 2020 02:10:54 +0000 (UTC) X-HE-Tag: alley41_041268927127 X-Filterd-Recvd-Size: 3795 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 02:10:54 +0000 (UTC) Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CB8E208DB; Fri, 18 Sep 2020 02:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395053; bh=1yo0w9oikYcQdPOP1xUf+233rPKYbWWdKsXczKStZbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JDq9hmOTtaCLKCcR864mTvkmwkqBX+KELc90iDg2cYLKcISM2RiJVcGajRXipluhE AG8DtZpYFahJM/YYu7jkNvUl32slZhD3SxsFKyesCdfcUOda6vieDILsaTDK1bhKFv PhXLIZUN+mkAHaXiTmqYuXJFQN7RNulce4n/BoBE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jaewon Kim , Andrew Morton , Matthew Wilcox , Michel Lespinasse , Borislav Petkov , Linus Torvalds , Sasha Levin , linux-mm@kvack.org Subject: [PATCH AUTOSEL 4.19 141/206] mm/mmap.c: initialize align_offset explicitly for vm_unmapped_area Date: Thu, 17 Sep 2020 22:06:57 -0400 Message-Id: <20200918020802.2065198-141-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020802.2065198-1-sashal@kernel.org> References: <20200918020802.2065198-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Jaewon Kim [ Upstream commit 09ef5283fd96ac424ef0e569626f359bf9ab86c9 ] On passing requirement to vm_unmapped_area, arch_get_unmapped_area and arch_get_unmapped_area_topdown did not set align_offset. Internally on both unmapped_area and unmapped_area_topdown, if info->align_mask is 0, then info->align_offset was meaningless. But commit df529cabb7a2 ("mm: mmap: add trace point of vm_unmapped_area") always prints info->align_offset even though it is uninitialized. Fix this uninitialized value issue by setting it to 0 explicitly. Before: vm_unmapped_area: addr=3D0x755b155000 err=3D0 total_vm=3D0x15aaf0 flags= =3D0x1 len=3D0x109000 lo=3D0x8000 hi=3D0x75eed48000 mask=3D0x0 ofs=3D0x40= 22 After: vm_unmapped_area: addr=3D0x74a4ca1000 err=3D0 total_vm=3D0x168ab1 flags= =3D0x1 len=3D0x9000 lo=3D0x8000 hi=3D0x753d94b000 mask=3D0x0 ofs=3D0x0 Signed-off-by: Jaewon Kim Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton Cc: Matthew Wilcox (Oracle) Cc: Michel Lespinasse Cc: Borislav Petkov Link: http://lkml.kernel.org/r/20200409094035.19457-1-jaewon31.kim@samsun= g.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index e84fd3347a518..f875386e7acd4 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2077,6 +2077,7 @@ arch_get_unmapped_area(struct file *filp, unsigned = long addr, info.low_limit =3D mm->mmap_base; info.high_limit =3D TASK_SIZE; info.align_mask =3D 0; + info.align_offset =3D 0; return vm_unmapped_area(&info); } #endif @@ -2118,6 +2119,7 @@ arch_get_unmapped_area_topdown(struct file *filp, c= onst unsigned long addr0, info.low_limit =3D max(PAGE_SIZE, mmap_min_addr); info.high_limit =3D mm->mmap_base; info.align_mask =3D 0; + info.align_offset =3D 0; addr =3D vm_unmapped_area(&info); =20 /* --=20 2.25.1