From patchwork Wed Mar 25 16:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11458245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81E9A913 for ; Wed, 25 Mar 2020 16:13:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F4F020772 for ; Wed, 25 Mar 2020 16:13:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="v0WIpM1p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F4F020772 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C0E146B006E; Wed, 25 Mar 2020 12:13:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B73546B0070; Wed, 25 Mar 2020 12:13:26 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB42D6B0071; Wed, 25 Mar 2020 12:13:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 924EC6B006E for ; Wed, 25 Mar 2020 12:13:26 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 72B7476E06 for ; Wed, 25 Mar 2020 16:13:26 +0000 (UTC) X-FDA: 76634379612.24.look72_7552829772707 X-Spam-Summary: 2,0,0,2a7d7101fcd7af4d,d41d8cd98f00b204,3jin7xgykcbmz41wxaz77z4x.v75416dg-553etv3.7az@flex--glider.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3876:3877:5007:6114:6261:6642:6653:6742:6743:9969:10004:10400:11026:11473:11658:11914:12043:12048:12297:12438:12555:12895:13069:13255:13311:13357:13846:14181:14394:14659:14721:21080:21365:21444:21451:21627:21990:30054:30064:30070,0,RBL:209.85.128.73:@flex--glider.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: look72_7552829772707 X-Filterd-Recvd-Size: 4907 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 16:13:26 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id n25so864398wmi.5 for ; Wed, 25 Mar 2020 09:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9BX0n1WXQ92lZ3MjH0wp89YONUx6z9n/+dehjK5QHNw=; b=v0WIpM1pWYkwfW5PVwQd91qMoqKoPvBlxk5SXEQsjIfMMxOtPM+uW/juD+jySvaulH LxFZBZE5K3u+fvVj3DCY4O/N1ONJ5YbXA9KOV+zNMLXnfYuoPorKqPcTkBK1lyckfFX2 H/Kt/afRihVhzJ6Tv3Sou0/zrBr5u6Ikl9oGlSL0/0Yc9R7mvKcikFH+dUf8h243Ygqg mKyTBa355YAJi6M3FX58ZmvqhVV8Mo0pRKuRN5lrWwNH22+m/Vp2rkgPhxclEWfTFt9U 42yL5U4Kn5z3LfW3oh87zTyqHvRleumqy/sJw+kN2KMopP+XH/vST09b1fl3T7qjxnEe WZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9BX0n1WXQ92lZ3MjH0wp89YONUx6z9n/+dehjK5QHNw=; b=WcL7i8LmJM00IPNoPk41IuJF/1ii9l5bch5mIDLJ5ld+q17y0Bu/ETzEGAFLqiZVeV 7Ejwuknn5Yw3i5Sf6gGpbg5cAHsCqiS1F/N0cgvJPM7YyjCqZ1qWvZDzJB/SkBjRuzmX OsxbQmz5lsHmUdfv4WOtsXh56rFAynPYTo653rs1mrkAwfQVUIyf2ETE9dPiJ5aByN2V oBU12jE/qEk75zEF+ujQ9tI7G2QHElei62g/2Iw5WDRfB63wuk6je7VVWnlnfEfu2Jcx Feanzc4qr6nAscqmBCJ1Gn7wVyTeC4H4pHPlmdP6E+G0DJgrz0c3hmfPu2ukRnIfcqQN +AYw== X-Gm-Message-State: ANhLgQ3kXv8HNga2D9Ps+WlMYE0LN7qwCKHyqGxP3+hHEjUhypM37TY4 Tfeg3exxhDxtrFSr5sH2Whv3c+/8a1A= X-Google-Smtp-Source: ADFU+vvKSCumhgQOV6hReLOBw8ulh/JizQ4iZVSUzNz7t4lCcDMEQL61jMkY5H7aaud2KNndSv2xEhILz+8= X-Received: by 2002:adf:f452:: with SMTP id f18mr1995316wrp.222.1585152804647; Wed, 25 Mar 2020 09:13:24 -0700 (PDT) Date: Wed, 25 Mar 2020 17:12:20 +0100 In-Reply-To: <20200325161249.55095-1-glider@google.com> Message-Id: <20200325161249.55095-10-glider@google.com> Mime-Version: 1.0 References: <20200325161249.55095-1-glider@google.com> X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog Subject: [PATCH v5 09/38] kmsan: stackdepot: don't allocate KMSAN metadata for stackdepot From: glider@google.com To: Andrey Ryabinin , Jens Axboe , Andy Lutomirski , Vegard Nossum , Dmitry Vyukov , Marco Elver , Andrey Konovalov , Christoph Hellwig , linux-mm@kvack.org Cc: glider@google.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, akpm@linux-foundation.org, ard.biesheuvel@linaro.org, arnd@arndb.de, hch@infradead.org, darrick.wong@oracle.com, davem@davemloft.net, dmitry.torokhov@gmail.com, ebiggers@google.com, edumazet@google.com, ericvh@gmail.com, gregkh@linuxfoundation.org, harry.wentland@amd.com, herbert@gondor.apana.org.au, iii@linux.ibm.com, mingo@elte.hu, jasowang@redhat.com, m.szyprowski@samsung.com, mark.rutland@arm.com, martin.petersen@oracle.com, schwidefsky@de.ibm.com, willy@infradead.org, mst@redhat.com, mhocko@suse.com, monstr@monstr.eu, pmladek@suse.com, cai@lca.pw, rdunlap@infradead.org, robin.murphy@arm.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, tiwai@suse.com, tytso@mit.edu, tglx@linutronix.de, gor@linux.ibm.com, wsa@the-dreams.de 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: We assume an uninitialized value couldn't come from stackdepot, so we don't track stackdepot allocations with KMSAN. Signed-off-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Jens Axboe Cc: Andy Lutomirski Cc: Vegard Nossum Cc: Dmitry Vyukov Cc: Marco Elver Cc: Andrey Konovalov Cc: Christoph Hellwig Cc: linux-mm@kvack.org Reviewed-by: Andrey Konovalov --- v4: - set __GFP_NO_KMSAN_SHADOW explicitly for allocations Change-Id: Ic3ec9b3dff3fff2732d874508a3582fb26ff0b1f --- lib/stackdepot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 195ce3dc7c37e..ba584910ad66b 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -297,7 +297,7 @@ depot_stack_handle_t stack_depot_save(unsigned long *entries, */ alloc_flags &= ~GFP_ZONEMASK; alloc_flags &= (GFP_ATOMIC | GFP_KERNEL); - alloc_flags |= __GFP_NOWARN; + alloc_flags |= (__GFP_NOWARN | __GFP_NO_KMSAN_SHADOW); page = alloc_pages(alloc_flags, STACK_ALLOC_ORDER); if (page) prealloc = page_address(page);