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 8B80DC43467 for ; Fri, 18 Sep 2020 02:14:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 31E7023787 for ; Fri, 18 Sep 2020 02:14:04 +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="1zFUqeys" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31E7023787 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 B70AC6B00A5; Thu, 17 Sep 2020 22:14:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFEC26B00A6; Thu, 17 Sep 2020 22:14:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 929B96B00A7; Thu, 17 Sep 2020 22:14:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 70A306B00A5 for ; Thu, 17 Sep 2020 22:14:02 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 42076362A for ; Fri, 18 Sep 2020 02:14:02 +0000 (UTC) X-FDA: 77274561924.07.size39_570520027127 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 26B171803F9A5 for ; Fri, 18 Sep 2020 02:14:02 +0000 (UTC) X-HE-Tag: size39_570520027127 X-Filterd-Recvd-Size: 3794 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 02:14:01 +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 DD14B23977; Fri, 18 Sep 2020 02:13:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395240; bh=nY6s31o4Uapbgqv3OMmpaHn2wWQKiW94YW1DjcUH4Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1zFUqeysbzs6kfaHFQVqD00vqWwxVAmiQ6NXB3AUaHXQMXZCfbEmnMJ3A4dBVXSeD v3Uiow/JV6S9/ui7e2Cps9yb2zgtCyRq383dpmp1f0vvdeZcbBW6/V4dzUCbt18Bkf RCqebSg5Y6d063y1gwGpckfYzTJfaXrdqJTVU9A8= 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.14 084/127] mm/mmap.c: initialize align_offset explicitly for vm_unmapped_area Date: Thu, 17 Sep 2020 22:11:37 -0400 Message-Id: <20200918021220.2066485-84-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918021220.2066485-1-sashal@kernel.org> References: <20200918021220.2066485-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 724b7c4f1a5b5..c389fd258384f 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2034,6 +2034,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 @@ -2075,6 +2076,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