From patchwork Fri Dec 20 18:49:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11306157 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 87FE8139A for ; Fri, 20 Dec 2019 18:50:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4AE5E206DA for ; Fri, 20 Dec 2019 18:50:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VAbnerhK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AE5E206DA 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 A44B58E01AF; Fri, 20 Dec 2019 13:50:41 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9F4D88E019D; Fri, 20 Dec 2019 13:50:41 -0500 (EST) 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 895D48E01AF; Fri, 20 Dec 2019 13:50:41 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 6F2C08E019D for ; Fri, 20 Dec 2019 13:50:41 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 2EF938249980 for ; Fri, 20 Dec 2019 18:50:41 +0000 (UTC) X-FDA: 76286411082.24.burn03_7a58b6107c521 X-Spam-Summary: 2,0,0,9ea4ed3db338ee4b,d41d8cd98f00b204,3_xf9xqykcbo6b834h6ee6b4.2ecb8dkn-ccal02a.eh6@flex--glider.bounces.google.com,:aryabinin@virtuozzo.com:axboe@kernel.dk:luto@kernel.org:vegard.nossum@oracle.com:dvyukov@google.com:elver@google.com:andreyknvl@google.com:hch@lst.de::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.c om:tytso X-HE-Tag: burn03_7a58b6107c521 X-Filterd-Recvd-Size: 4917 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Dec 2019 18:50:40 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id b13so4112456wrx.22 for ; Fri, 20 Dec 2019 10:50:40 -0800 (PST) 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=YQikJeZNsDFPK+4tami8AEHpLwfzIVgVWknHl+1lDAA=; b=VAbnerhKrh6M5Yh9MnCJXF6/3YxPISh46Ho21u25tVPB+2Qd1lTuTfbZkGlBVBJr1W WTZ0J4U6UnrHL/6mh9ZsDkodrUKwpP5FeogKZmzp40GJUSumsdm632eGPQFeHWTgPP2/ WlfAf36KaGMSiUuXyWG5UxXuZZqj52opUx82kMFnzH0SvJWsBJcEdJjRYrZcAIO9/Zcn xFi7jDWY9dlIEM5xb2fSdeewDZ4Iu9RSCc6OgS54W5SYKlWsdPQWzQU5DN85MZxxhX0k 6TESp7o7lxrPx0wq3/Yb4Da8d3dSYTgfpLZVT35MATmMnc7P3350sBYMb5f3jHRdu9nu rHWA== 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=YQikJeZNsDFPK+4tami8AEHpLwfzIVgVWknHl+1lDAA=; b=FLaSg0aPuErLYJfjVVjXJkt+w24WwnUExuEcsB5OoZ5CVYDkgS9oB2bEMIwQhXi/sj UPKcYcQLIhpR1v+CKO1dBJ5R7hP+IesHDo/LNofczub4yiz9Ew8sh7Y1amMXQlqPu8mX TBF8P38O7yGRwtUjNn5pXdKsh2ol/i7A8aNut6NVsM/f0OdmBVjUofhzLtCiIeohfufM /Qvpoa+sxkBt5hIlD+9U8ouWL2jGWQ7vWIZ4uyPVGEKoCqxHiyqjtl2V/+UYUu8NCHWE UEAcJ1vYn9mhR5aED7LP4Dh0DNMsk/TGvycaDSc2SjEE6+LTRXc1FJlwrAR/DEL7QBPs zqxA== X-Gm-Message-State: APjAAAWqlWIEEpI0QPtFD2eGKnBc6x9vaefq7QwTqssyYQuaqpxskKxx SNfkmq1JnJX8heIZs0aZxWtr9vpq1AI= X-Google-Smtp-Source: APXvYqwU2B19mL7FFZXIHKXuzhU5G0RH4W2xFLR8nmOKrLUmeMJCNIcaNHkzefOOBseRM+8hX7uyk8VMHx8= X-Received: by 2002:adf:dd8a:: with SMTP id x10mr16858021wrl.117.1576867839176; Fri, 20 Dec 2019 10:50:39 -0800 (PST) Date: Fri, 20 Dec 2019 19:49:25 +0100 In-Reply-To: <20191220184955.223741-1-glider@google.com> Message-Id: <20191220184955.223741-13-glider@google.com> Mime-Version: 1.0 References: <20191220184955.223741-1-glider@google.com> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog Subject: [PATCH RFC v4 12/42] 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 --- 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 ecd1a0dfb3fb..2e7d2232ed3c 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -295,7 +295,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);