Received: by 10.223.164.202 with SMTP id h10csp2731900wrb; Mon, 27 Nov 2017 23:53:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMYOc5g0mZb70IIR5HKR21O2c4s5U4dHtUEJ4LbFPXhbHGN6Q7NtqJgyrFf/HIRURIY9dzQ4 X-Received: by 10.98.89.220 with SMTP id k89mr40175577pfj.36.1511855600762; Mon, 27 Nov 2017 23:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511855600; cv=none; d=google.com; s=arc-20160816; b=cJEzRVxBhfclNLPJlOW8Fjr94o0GUIF5hYcIEwxtopt/8dZiX9irbVvUrac6oGxgkg RSxT48N6ycOg4Q6ZIejoBukM8agYr6O0mb0GUWlCGmh26xiiEhk0XQERMP6DWPYKufQy 66yrBLPF6nMp5pu5DZD2zxtqEzyaKS5XmfKqc3WydqYV7cdeP4yC5D7T9a8+z6tgte9r +KY9vhDdkQZ7O72144HxzqFHKlsPcqOorL+nf05GvMH9X1MONeCjpMpioTbQ7QkDbFur RTSWkoDb5Em6p8jSSpQr37fM8Pjk98iLTF7cTMKGbSPmW4ldn5lmoM4KE+ixER17iCJU VG7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=mWyGVzG1f84L8PDfrnUVUExFdAAFduWiMYo37NgGrfs=; b=SVssGt9Bt1Ew9rZoKwckIS3KR+66W5Vl/5AgBDbzfW57Y/O8qAQWE29DLrbKG4ZxVt a9Gi0ClfzZXNJwT6/gAf6CJbeZERDmtP/6HpdKcVJQ4andYp+UTqRFqbaRoc1DMCCKpr +pPPsQJMmIkGHIhb6aRfGKCEJEN4Y9k7rHPFmvoLQLQa2Mpyvlqx7RVqcpYs46yvkkIC LH7YzDalbTiDKk2zQ539AEd6wzK86TqsG2p6Fbdf+PkYEUIKM+HRIWj/zrw712IFSAnw 9JZoa9ETKwzYnGa0KvxGH2wjgrJu+SXKXswRHjkHCc2Hye5OR5IbHYcBJpkRJoKOadNJ cgVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bJXIvQMx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si24627195pgn.698.2017.11.27.23.53.09; Mon, 27 Nov 2017 23:53:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bJXIvQMx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbdK1Ht7 (ORCPT + 78 others); Tue, 28 Nov 2017 02:49:59 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:43965 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbdK1Hty (ORCPT ); Tue, 28 Nov 2017 02:49:54 -0500 Received: by mail-pg0-f67.google.com with SMTP id r12so19916289pgu.10 for ; Mon, 27 Nov 2017 23:49:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mWyGVzG1f84L8PDfrnUVUExFdAAFduWiMYo37NgGrfs=; b=bJXIvQMxkxv7n+skjEGknhQqPqZjbL4pNTDLygbuxjYFle1xWjhOnpfEePMZvHy5iu VDe8ZWwpjLy7hMiXmPrtxm7ayF5R7uPT/6ImqMOCcsOyMGgjrsYc7CtFe/WoBz5dol8M TAEStlxr+z1AXK94q8D/gA6jWo/b7m3Ny9+ZoKAdmLe5FIv3FfOVGSdnMR6+UnSAWlwP 4zlBnyIqRKqmNPeUmZfkTd1UeW0SG15QS07uIjfaUxqxZf8hrKiQOpz7zYDhFoS8/0bQ QNevDVSFAPDNA6MN19x/r5q6zwT956OzVo3Fqof0oxksjCr93Glq7KwAY3eb/RGpt0jF P2kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mWyGVzG1f84L8PDfrnUVUExFdAAFduWiMYo37NgGrfs=; b=rk3f2V4uCQ6i1FC/giuKtMUzYbTo5cL9IxzMHKLmY7gaarfaURSrnBaUu/4CSZwkuU powj6SI0G9T1qQB68MrBAHnSs9BM/gFLMaN/AU3liKW2ifZjqLLaGiSQmCBtN1h53m4h rFi/TpShtnFj/1tHlpqjCrqi36R/UxfrD07DImyiFsKg/+IoFLTXAhEtFvWnp42ohNdv L8dayI17rkWBb5ae/yFtHiQ+X5i9VFTFdW9XzF/Ndz0iW/x23YBGjvSMNV4oBgBI9iZA Rp2o7gFRM/o19kV08LU4a+dAl2pqOqF3J2lMIFEw8OmSvpr0DiWjmaOIqUpxpdO/JazX icbw== X-Gm-Message-State: AJaThX5E/DOhyPUqFF5oFImC3WrzWeCrZACVHVLkhKih+Cq97ISiJGaC jCCpk+DtTCSmzjyiv8VxBrM= X-Received: by 10.98.14.144 with SMTP id 16mr21686692pfo.195.1511855393787; Mon, 27 Nov 2017 23:49:53 -0800 (PST) Received: from localhost.localdomain ([124.56.155.17]) by smtp.gmail.com with ESMTPSA id 67sm39403946pfz.171.2017.11.27.23.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 23:49:52 -0800 (PST) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Namhyung Kim , Wengang Wang , Joonsoo Kim Subject: [PATCH 10/18] vchecker: Use __GFP_ATOMIC to save stacktrace Date: Tue, 28 Nov 2017 16:48:45 +0900 Message-Id: <1511855333-3570-11-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511855333-3570-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1511855333-3570-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim Since we're finding a cause of broken data, it'd be desired not to miss any suspects. It doesn't use GFP_ATOMIC since it includes __GFP_HIGH which is for system making forward progress. It also adds a WARN_ON whenever it fails to allocate pages even with __GFP_ATOMIC. Signed-off-by: Namhyung Kim Signed-off-by: Joonsoo Kim --- mm/kasan/vchecker.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mm/kasan/vchecker.c b/mm/kasan/vchecker.c index 6b3824f..df480d5 100644 --- a/mm/kasan/vchecker.c +++ b/mm/kasan/vchecker.c @@ -301,13 +301,20 @@ static noinline depot_stack_handle_t save_stack(int skip, bool *is_new) .max_entries = VCHECKER_STACK_DEPTH, .skip = skip, }; + depot_stack_handle_t handle; save_stack_trace(&trace); if (trace.nr_entries != 0 && trace.entries[trace.nr_entries-1] == ULONG_MAX) trace.nr_entries--; - return depot_save_stack(NULL, &trace, GFP_NOWAIT, is_new); + if (trace.nr_entries == 0) + return 0; + + handle = depot_save_stack(NULL, &trace, __GFP_ATOMIC, is_new); + WARN_ON(!handle); + + return handle; } static ssize_t vchecker_type_write(struct file *filp, const char __user *ubuf, -- 2.7.4 From 1585311253859323995@xxx Tue Nov 28 12:03:46 +0000 2017 X-GM-THRID: 1585309391506619544 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread