From patchwork Wed Feb 20 12:45:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10822095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19D331575 for ; Wed, 20 Feb 2019 12:45:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004112C665 for ; Wed, 20 Feb 2019 12:45:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6B622E086; Wed, 20 Feb 2019 12:45:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 733AB2C665 for ; Wed, 20 Feb 2019 12:45:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37B8E8E000E; Wed, 20 Feb 2019 07:45:36 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 32AD08E0002; Wed, 20 Feb 2019 07:45:36 -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 1F4238E000E; Wed, 20 Feb 2019 07:45:36 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by kanga.kvack.org (Postfix) with ESMTP id BD9CD8E0002 for ; Wed, 20 Feb 2019 07:45:35 -0500 (EST) Received: by mail-wm1-f70.google.com with SMTP id v8so1727699wmj.1 for ; Wed, 20 Feb 2019 04:45:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:mime-version:content-transfer-encoding; bh=aaoljckUWXKFfeKRZfZeobgkbuOIuC7kgR+jgoF4iJk=; b=iRFb3ZL4Wa0rpFyxZ7+phnSim9fiTqYtebAmGuh4c/w5HeQnPZkpoHik2rW5N89UXQ N2W5LndY13TpGL7ZqGqyzE7X9JxBiB+RHXc4sgaa9lPZQZhqBAak7JinuR5cRCW1dfkX BPJBCM3Y0lTRH5FcHbVqM4G7MyDxvHx1Eaqwo+Ga8rpdJmFSp+vdH/KMMwwIgpHEagiu XhTDvbnjHiYBaVQbm2wN0HNN9hhHVD3/3kn9rf3rhBEhCNfzPjmkczyykXLB+2GVtcMt FBuMZ9XnLlz8SuGJIpm+9mfwHEDKFqqqCA0qonqROyH/ZSjPUqKGuUEwZFYv6Drb2Fj7 PatA== X-Gm-Message-State: AHQUAub/TSzKurpE/zzSlLQ9axcerJmUuoBUBBRz9eQExKNqZYLSY/76 lJF7EqJT7w1/eGEXqvHzX+GrF6P1xfUNgiE4NwM1HNFQsLQn+ZzUFo6VFodGEqaC7xfL78LFF4E xBLVK0l41i9PIDSlBrGugQ8Yzz//D2tkWHCHWPQ/d44N1plY7UapMeZIBZI+Q10nEumA3chCbqO /8n8f+yXPKBxehljQLAxrz5ofK38gvTh9d4CC0DKBiXgSb1451LQnYg5U1z/tdCDfZDnx1q19Fi RoNEFmZFoKsErL3jie3eUNtYKkTLqQSPjHBted90/Imgl9lUsLOPAQOGFxJrOUJUhmXfUeLIAGQ o3iJt0fUVMhNLztpXL1SHIChiBWwFeybe8D4hs7KmqznW+wL3fPuSgrMUaaiF8moZCop/YqyZXR Q X-Received: by 2002:adf:f786:: with SMTP id q6mr7998198wrp.125.1550666735231; Wed, 20 Feb 2019 04:45:35 -0800 (PST) X-Received: by 2002:adf:f786:: with SMTP id q6mr7998155wrp.125.1550666734251; Wed, 20 Feb 2019 04:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550666734; cv=none; d=google.com; s=arc-20160816; b=jfFdgUF4ogbgeLiKAIL2U/1ffxvIeON7Cn8957niXhmrK4EFBs42862cgKNcF+jgIn OgQjV2g3UlVHfWfdMmg7sqJSPgQN3niBcXyGerTNeIhqGppeTUJfGvSOLiM7tTs/TpMi pEd4KG6+a4dI+kuJcS6NBwXs7qlmYdVw2s5An3/NqdVbqC7kBl4WgaU+u0tampC0r3R9 C/zRxzK8SYl8jy+fUjnyuQrLAH34dY5nnPsBBsBOS5PqGYp0x2k4dfLsOwt/kFY5SatW 7UiDR/RzY5Kwov1gzsgyE6TR315Y5DEj5ep7b9g1yeyn94HA4GTub1YjY5cOYm3OgyGO SY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=aaoljckUWXKFfeKRZfZeobgkbuOIuC7kgR+jgoF4iJk=; b=0WKewkWDgEBoEe1qAnkCXTyaOxDsVrdhaHFaaCy9hFrsZox/gSu0MCvp2cAFsB9569 Us5UvpdI7iXUjXwEdT/pVLsWiF+C1drJtJMSL+SKOsYA9/D0rVswPJnXmI8sC24OmArH zRNBAb+qvqRGGuuJh1BgFJ6AUvZd8JIZ/+pyUE3WkZMdJHnJjbgLbi8n5DZc3ucPN2qK cNiBO9o1eZ3rm9SuRpgxXbh24IDffD++wnSG2Y1viVMTsSU9M/7Fh9CfyLdLxryscEsc Xk2xq/nm8VgpD4t5pzRo/hP40BzmNzz9FnsKU7/6srUYEbYBwODGV2aoFcCtR3ZnNlj4 xCXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dCOPqR5U; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v4sor9289709wrq.30.2019.02.20.04.45.34 for (Google Transport Security); Wed, 20 Feb 2019 04:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dCOPqR5U; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aaoljckUWXKFfeKRZfZeobgkbuOIuC7kgR+jgoF4iJk=; b=dCOPqR5UrKNy/r0gjEIkUKwXsNa3lqaV8sDMBn1OFghR6pdRIBuiH3LFXpJduArWHy QaCnlzYPUFbkqtAFyZrxQcZdVGWx28NjSPL8HCV8eCAgi/gTX7GArzZCa7EYUTlRVgfJ aQPv8HLTo8Hh6IQAhrMsYkO0+Y64RGeF/xTCt8LY+lkuKeOuzVlMOXyUQw72lTrxCCoR hVkRHVHerQDTiqt71u2jBrrOofsTEp/vWPOkV0TAHiaijjr8GAtgukm9R6JwRTf2llpU T9Mmuof7mcWq/f0BCOypG2mg0kE5Mc6dqLbwKcRI6EVyNpKcGQt+HF1NLdw43wUYqvYv 8/8w== X-Google-Smtp-Source: AHgI3Iahe8QNa86C6LoUNOB1tqAbTiNm3ZOgBS6ROc45eIbTQYdz863wRnoMcCuGABBxrPdDyzXdCA== X-Received: by 2002:a05:6000:128f:: with SMTP id f15mr23652406wrx.74.1550666733631; Wed, 20 Feb 2019 04:45:33 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:13:8ce:d7fa:9f4c:492]) by smtp.gmail.com with ESMTPSA id f196sm6378889wme.36.2019.02.20.04.45.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 04:45:32 -0800 (PST) From: Andrey Konovalov To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Qian Cai , Vincenzo Frascino , Kostya Serebryany , Evgeniy Stepanov , Andrey Konovalov Subject: [PATCH 1/4] kasan: prevent tracing of tags.c Date: Wed, 20 Feb 2019 13:45:26 +0100 Message-Id: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Similarly to 0d0c8de8 ("kasan: mark file common so ftrace doesn't trace it") add the -pg flag to mm/kasan/tags.c to prevent conflicts with tracing. Reported-by: Qian Cai Signed-off-by: Andrey Konovalov Tested-by: Qian Cai --- mm/kasan/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile index e2bb06c1b45e..5d1065efbd47 100644 --- a/mm/kasan/Makefile +++ b/mm/kasan/Makefile @@ -7,6 +7,8 @@ KCOV_INSTRUMENT := n CFLAGS_REMOVE_common.o = -pg CFLAGS_REMOVE_generic.o = -pg +CFLAGS_REMOVE_tags.o = -pg + # Function splitter causes unnecessary splits in __asan_load1/__asan_store1 # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533 From patchwork Wed Feb 20 12:45:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10822097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2EBC1575 for ; Wed, 20 Feb 2019 12:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B9A92C665 for ; Wed, 20 Feb 2019 12:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EDF42E086; Wed, 20 Feb 2019 12:45:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B54F2C665 for ; Wed, 20 Feb 2019 12:45:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A353F8E000F; Wed, 20 Feb 2019 07:45:37 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9BB708E0002; Wed, 20 Feb 2019 07:45:37 -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 7C43A8E000F; Wed, 20 Feb 2019 07:45:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 1E1418E0002 for ; Wed, 20 Feb 2019 07:45:37 -0500 (EST) Received: by mail-wr1-f71.google.com with SMTP id v24so10362913wrd.23 for ; Wed, 20 Feb 2019 04:45:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+VnSgGIcvAVUjgW6Yip0Hrcu3Y+bDJDMuLdNyR0jxRw=; b=ekf5V/7lwJMCP0xYgEqtySoNFljRKCY+MHeZI481OuQ7V9f8lAu0x4/X3gi9X1+yDj 3LXJcIhRmk89g1VRQGLCqDiAxSPukUhMi+N3YJEkAg7SXdJ193ETuk/jmllSL/D1bAbj RJUbeAiEDV2oswJBxVKhN8nNW21rB9P7+f4dapA7jUmv0J8k+saBs3u+aRbP+84O0Do9 3sYZAZbv3Zsx9t49SUMlW8oUP7VArdkTKFM9IhAdFhACli7D3BloBsp3MXOXqfPehqhj DhTMyjoS7VOdW+AMFHXstAKU7Ivp2k6T/c2PogsQSJR52LkQdTJa1XCobOgX9GbWarra ALdQ== X-Gm-Message-State: AHQUAuZyZEBjC4nSccf72XEWq3VSmuCXCn4FZjhm2Y4vMJnajZqeALS0 gpvsj/3nslmWhWjbN9fde3HpRBeVlhqZKqNKTf8uaao5PGA3UYTljeocDq2t7MTfZN6+CLkr1rb g+mNMK1D3KX5RfX+3S8OUdIDHZNOMdlSrgraoOaT4T+IWzFcgpbALRm0zphPWaLcJ800zAj5Np9 ymNMb6Yt/rnbmHRW2JI/0PJO4C7goCsSlLqB/q0rKJPLC3AGOJYq/nBCQkJ3ev1MftCvtwEzq/I ETXdgC53v/R+6HCJ3PChRYcK19zBo/m2Wb0FxMmVZJTieG1I39Jo0onblbDdvKScAhr6datFlQn ukOb+LLaWxeUIeVkgWasPVE1FdRupkW25S1ZYakUT9a4NIHs4Yql8UjroYyZqjWZk4zHW7hdi1I a X-Received: by 2002:adf:f343:: with SMTP id e3mr22906799wrp.205.1550666736494; Wed, 20 Feb 2019 04:45:36 -0800 (PST) X-Received: by 2002:adf:f343:: with SMTP id e3mr22906761wrp.205.1550666735744; Wed, 20 Feb 2019 04:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550666735; cv=none; d=google.com; s=arc-20160816; b=I5+6F77IRTiAUyTfkqHA5P6JcDP8iDv4SYtIpE2L+GvNhZwdrI8/EWINPXhU0sOMDV 9lp7+DBy2Fl2xiDc+eVRyYuoRcAE7+C/fDYDLMS1mFL2dF1slOws88V60JI6tCqX/dEY PEGB8QoryYyEWxBzazrMtKOGX4ensBhqzBY+cfuKJGXyLlNH2wdj1KHxwpZSG9OlXZBL NHB2/4LzPt4xNRw2Zow5TE6u81otjgj+uL8e6OuMPhagTAQ6vE3muw72LNT5ViMifp3w a9zfN1mP/9r6k1FmL4P/mY6i1wMFbBpg+1jP9g2VfrU8QC2YAffwVqF6GerruNDrX1FG 9N2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+VnSgGIcvAVUjgW6Yip0Hrcu3Y+bDJDMuLdNyR0jxRw=; b=aSBh7CebrqmWCf3HoailUhdX9qVCwXR6S0KQVCsEsx4fljoQOXvUqSPHXrhsetZ8bm WuchVqp+0sMMMOd0mnpd7ctKQT28B4RMrKiNhim2K2i7FccQ7qHcUt7OaEGVhXS915FS 3bhJvRPGyhs9Kv+F37Fo1viA+XEcysHgkKVdAaqYlvcy3kManJ18ey2CgS3itjFi4G7C ahER6fgr4oMdPyKmBcdIBu6DIGj78pXdBTixdT47+tvjT4z+7RCnSa6agjpzr3aRNt2Q glLVnKjuvHoFMPpD3KwT+bN7QTmprE6e819XP3Lt3E5s5IYzDgMXr5GQOIIM7q2wKorB RxBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RkuGNSEi; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d1sor10015706wrp.39.2019.02.20.04.45.35 for (Google Transport Security); Wed, 20 Feb 2019 04:45:35 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RkuGNSEi; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+VnSgGIcvAVUjgW6Yip0Hrcu3Y+bDJDMuLdNyR0jxRw=; b=RkuGNSEiWiBLUh5xUgWCC7aRfo5c8cmVpDx8tczf3SsCt/JNp7bl3CEPAZ6bIuphr6 0qKGZlUEZX3FmSKQMud3QrYDhZGWbFY6JJ9gUXazEMSCQQNUiJJf32ojxJEj+xg1L+Tn zC9QKnEJByoPIgtwi7RtLJtG/4uVYgPOGXtZOP5AZsYJtPUVWBch17nA+JuMjTYAo0CW Auv5Lb9zfCy/GLO80qQIv+HIAK7/5Q1qIqeL00en4QDK0xASfoSHpM8wL4tWvvgpkb6c xq93SHrk6KiU4c26SCT4nfkCwzOhkzWfCNaV+nzb0aIBvJcOK6l0ln0jviTh/RXYY9AT C31A== X-Google-Smtp-Source: AHgI3IZCQAIZAKtPesdCePJTdMeBXMjkB4yKP6E02FjEZNJbh7DAEvbOIwdxq/2SRWXrl5Daqdq8dA== X-Received: by 2002:adf:9d1d:: with SMTP id k29mr23582142wre.211.1550666735197; Wed, 20 Feb 2019 04:45:35 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:13:8ce:d7fa:9f4c:492]) by smtp.gmail.com with ESMTPSA id f196sm6378889wme.36.2019.02.20.04.45.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 04:45:34 -0800 (PST) From: Andrey Konovalov To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Qian Cai , Vincenzo Frascino , Kostya Serebryany , Evgeniy Stepanov , Andrey Konovalov Subject: [PATCH 2/4] kasan, slab: fix conflicts with CONFIG_HARDENED_USERCOPY Date: Wed, 20 Feb 2019 13:45:27 +0100 Message-Id: <9a5c0f958db10e69df5ff9f2b997866b56b7effc.1550602886.git.andreyknvl@google.com> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> References: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Similarly to 96fedce2 ("kasan: make tag based mode work with CONFIG_HARDENED_USERCOPY"), we need to reset pointer tags in __check_heap_object() in mm/slab.c before doing any pointer math. Signed-off-by: Andrey Konovalov --- mm/slab.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/slab.c b/mm/slab.c index 78eb8c5bf4e4..c84458281a88 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -4408,6 +4408,8 @@ void __check_heap_object(const void *ptr, unsigned long n, struct page *page, unsigned int objnr; unsigned long offset; + ptr = kasan_reset_tag(ptr); + /* Find and validate object. */ cachep = page->slab_cache; objnr = obj_to_index(cachep, page, (void *)ptr); From patchwork Wed Feb 20 12:45:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10822099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 058C91575 for ; Wed, 20 Feb 2019 12:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E29792C665 for ; Wed, 20 Feb 2019 12:45:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5BFE2E086; Wed, 20 Feb 2019 12:45:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7441B2C665 for ; Wed, 20 Feb 2019 12:45:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E6998E0010; Wed, 20 Feb 2019 07:45:39 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 971078E0002; Wed, 20 Feb 2019 07:45:39 -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 77BAC8E0010; Wed, 20 Feb 2019 07:45:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id 1E0908E0002 for ; Wed, 20 Feb 2019 07:45:39 -0500 (EST) Received: by mail-wr1-f70.google.com with SMTP id j44so10388398wre.22 for ; Wed, 20 Feb 2019 04:45:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fQB33hyusb/Aumyn6Q8kWmHk/TEqVmhId57aQJXdZ/s=; b=K7pUWCDnEYfgJIKmQZy316U1la515FQtDThFLIjyV88Ffxhmp/5g/xmN9WzspZj5O4 fo2A0pjSx/2U9BSPdxcZJve8A/ya2BESIyfnJB2BbkcCGPRnYAUWSFNRpVV2UWoNor1y TJ+APaJdeFLcK7sML3/SeQTQFcitqXzmapGtnUs5yK/sf7A2r0oc4CYH7v1LV1VAqGMO W7Riq2MDSjGE+0PzP1tnzr7IydpYogOIrBJ7M1Ye57wCjHhOm5PqbLpJgg7ugR3FXZQk LScRGilABLWy9RMibQVlELE2gxZzA8YGN8g/TIMTzQtnKKjxqAmi6vlNx3kbUIZuQfwf edqQ== X-Gm-Message-State: AHQUAuaSEDlqybQQWkUsCDN88U60aq90SMhYRWJtM7wsHZYnToQ2c0YK 4mn1tr60RrzrYnRXiLUYsJ0ky4jK9K5ZjgFBTZ7UDl2VhvDh4eLzAfda1cmbufHNRuqp8qntAVZ X1D694/8RMrIDaFOjt8zYAUcdMvmAdCuo2Rt//64ASEtHFmc6mWqqpPR+fDmw+QL/n7y7ySxKeD VtJREH4uza0G7vWARKhXdJQ61DL4tYdjzF+KyY05DFhDGPHaPtGD4BxjUUf7SFoZL2y7iG8nOhP OQ1BS869wCUxl2LjX4/v8uve6GQRUvkbYBlPcaPs9+SC4+EVW5+y2Y/5eTa7Q0lDVOW/IQ8cO8S 9OmVJ5qIRRwnTf0/MdAk/LvvZ9E7VMLNUTM5hoKjRQ+DPkS6WMMxROOur48QaCTC9Vs3STzUcIE o X-Received: by 2002:a1c:7906:: with SMTP id l6mr6329195wme.83.1550666738623; Wed, 20 Feb 2019 04:45:38 -0800 (PST) X-Received: by 2002:a1c:7906:: with SMTP id l6mr6329155wme.83.1550666737708; Wed, 20 Feb 2019 04:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550666737; cv=none; d=google.com; s=arc-20160816; b=LTTYel4yCsqfSjhuvQn+cc/bFy/DUlyDy5EEerjKy2i84Jx2W+KXSnU0yaqmdFWS1y 8VmWW36Hx0FYxWc8U7DfQ3/OtFfi0S/mgzo2rmgdEKnPC1nQosGBmS6+fk1krRt/nzZW vggcKpVTRJIjRmgkBNMreXyvgT8kTDnygzy+IyDwKCjm1AyI18DXmw6faDNeS15QXxam sA8BW874N0Fik53F9YRDAMXN8RnnHTmx6QuMxjbERV3e+6lyZc3n4w3tNazi+sUXas/J 346Vj1GlN3ykLEDI/b00Bpp/xlOBo8Gr+5hCCAFcx0wzgmcfbmEn8Xrq8ZObXr7p95HL A2mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fQB33hyusb/Aumyn6Q8kWmHk/TEqVmhId57aQJXdZ/s=; b=UYdDF+mqJBopXb8vLkMKmxUF29lK1QFizeC/ua+mO7qDeelX/bi6Blv6x0iBjTinKA YfwNdxqrqsfgCrwCm6Ygx87XfTJOfO192MPDg2gVUSxK7np05yRiQ9TLtyEETLugoJqj OX9drnJPYNBVJyS+AT8ufL/h37HyxZ4mQ64srF8WM/yn1UDRUu5boALWG5mTLqWOlvVQ 3Vp1SxBtVqps9yuuw7KHUtV3m+METIwsao3IIRULGJFiE6oPVIP0B3iamc+hlsOc8g+D lZIEXgNEZQaLqpTaHFEJ0LyIgDKGz9z/308HubdJ8GkfawamG9wXskWIN4zOTIDpXTsz tkfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=X6HuAhFz; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id n15sor3588638wmc.23.2019.02.20.04.45.37 for (Google Transport Security); Wed, 20 Feb 2019 04:45:37 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=X6HuAhFz; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fQB33hyusb/Aumyn6Q8kWmHk/TEqVmhId57aQJXdZ/s=; b=X6HuAhFzVyDsIJPV/pL41HvGaDjlO0vTjXr2OZYAtADiu/Lz72YRfW1+XD9Kdt1DGo ghaPVtBevuMsjzRo5NRUgcGyU1fFMsSNZ/LRvovoxzUvGIVFHnqrcxEMrJ6T5B5iZY2S hGCTxP/7qnF8GV1WG/B+RacmVNJAHrbTmi3UPnWjdWHBHjUZ6cNdUqkGBBhFTJW+I22Q wnNLhzebb6NpoY+sHoNkDH45qrl5ETQMktoHEyMw9VhTZCXBjQONgHOi9gp8rEUMp9w7 4CzMQhjHcfURWYGvo2aRaj1na8HB27pSa4QKQO39LnpskYbUWfDhfVukRRSU3jECiRUP qDPA== X-Google-Smtp-Source: AHgI3IabI55h01GTJOovj1LFUoTaAv7IadDL/Z17sRBOfQGy3+UYf/86H6vdZ96ggIYEFKXQhNkZ0g== X-Received: by 2002:a1c:5581:: with SMTP id j123mr6011804wmb.10.1550666737166; Wed, 20 Feb 2019 04:45:37 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:13:8ce:d7fa:9f4c:492]) by smtp.gmail.com with ESMTPSA id f196sm6378889wme.36.2019.02.20.04.45.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 04:45:35 -0800 (PST) From: Andrey Konovalov To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Qian Cai , Vincenzo Frascino , Kostya Serebryany , Evgeniy Stepanov , Andrey Konovalov Subject: [PATCH 3/4] kasan, slab: make freelist stored without tags Date: Wed, 20 Feb 2019 13:45:28 +0100 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> References: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Similarly to 680c37ae ("kasan, slub: move kasan_poison_slab hook before page_address"), move kasan_poison_slab() before alloc_slabmgmt(), which calls page_address(), to make page_address() return value to be non-tagged. This, combined with calling kasan_reset_tag() for off-slab slab management object, leads to freelist being stored non-tagged. Signed-off-by: Andrey Konovalov --- mm/slab.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index c84458281a88..4ad95fcb1686 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2359,7 +2359,7 @@ static void *alloc_slabmgmt(struct kmem_cache *cachep, void *freelist; void *addr = page_address(page); - page->s_mem = kasan_reset_tag(addr) + colour_off; + page->s_mem = addr + colour_off; page->active = 0; if (OBJFREELIST_SLAB(cachep)) @@ -2368,6 +2368,7 @@ static void *alloc_slabmgmt(struct kmem_cache *cachep, /* Slab management obj is off-slab. */ freelist = kmem_cache_alloc_node(cachep->freelist_cache, local_flags, nodeid); + freelist = kasan_reset_tag(freelist); if (!freelist) return NULL; } else { @@ -2681,6 +2682,13 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep, offset *= cachep->colour_off; + /* + * Call kasan_poison_slab() before calling alloc_slabmgmt(), so + * page_address() in the latter returns a non-tagged pointer, + * as it should be for slab pages. + */ + kasan_poison_slab(page); + /* Get slab management. */ freelist = alloc_slabmgmt(cachep, page, offset, local_flags & ~GFP_CONSTRAINT_MASK, page_node); @@ -2689,7 +2697,6 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep, slab_map_pages(cachep, page, freelist); - kasan_poison_slab(page); cache_init_objs(cachep, page); if (gfpflags_allow_blocking(local_flags)) From patchwork Wed Feb 20 12:45:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10822101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 178BE1575 for ; Wed, 20 Feb 2019 12:45:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F327E2C665 for ; Wed, 20 Feb 2019 12:45:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6FA92E086; Wed, 20 Feb 2019 12:45:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88E322C665 for ; Wed, 20 Feb 2019 12:45:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26DB48E0011; Wed, 20 Feb 2019 07:45:41 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1F2DA8E0002; Wed, 20 Feb 2019 07:45: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 09DBA8E0011; Wed, 20 Feb 2019 07:45:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id 95BBA8E0002 for ; Wed, 20 Feb 2019 07:45:40 -0500 (EST) Received: by mail-wr1-f70.google.com with SMTP id m7so10564027wrn.15 for ; Wed, 20 Feb 2019 04:45:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5gXqyUm+MzCzLQAxtw4op9wk2PcKOTUHWZhWJctI3Io=; b=Sa6dccvlkcrbQSYUFlLHTRU7bWWNLMV2CyWM4qWQNKQZth7+r/yVr9DOo3q5SfXpVN IDltiW9uKv5Ka3JGO9aLbvTT6YSdrSC/iyLQbaRFFYE+U+RVcnQ3A5WX/2JCR8LB667G TBkUVwP1h4Dk+UFk9vIU6keMvl87/r3/IdwOwR+6Z8XC/Nc7FucYj+//uzmMiX/8GNdb zsASCQCYA6O7RToc80qZOd/ufnEYPIu0EyP2WqYMlVv0bxtnXS8t7sG4nCTWswiH9ogW 17W6nzR6HJQjg8LqUKdVByDPeyHBipdMUMTd80w4sGMlze72F4eE6goNdmFdj20AEafL iJVQ== X-Gm-Message-State: AHQUAua+hmNVpkLKCiNyz10a4Pad0Kx0hjOwRkPdcmEdSdl/f2j4zcO3 swQU3ltzJ49HqcZsbd6kkDTBNo+1QnSahvvuehQ3o3uQ78iun9RPS6OC0oRg2EQKw9HY8HD2p6r bZEXnqOicKolj54UwXHih9bZTxTyGeCzbn8ws0hnDQP0mW10licgpWHfte0mUeTJQsuh83nDr/V wkSVQKcG0v6hm6MoRlOdhN+M2tdpPXXP8kLpuvXXG1JytSptLCYDF6aAjkvE7q60YM/qeCo8StI R83eCXR5s6dAOV14RzLHKqFRxfUWdPNG3SI+u8+bXxxCi1gYfjeW491czLJbGp2NXsXbcLk2xNl saoFJjVuq5+gN+Bhxi+UkkQb7Yuf8Tzoz2aTKJh/oXmIKhzhVWEKG2+nxPnSlrcTWgU7dZa+6h3 J X-Received: by 2002:adf:f5d0:: with SMTP id k16mr9177725wrp.325.1550666740115; Wed, 20 Feb 2019 04:45:40 -0800 (PST) X-Received: by 2002:adf:f5d0:: with SMTP id k16mr9177680wrp.325.1550666739187; Wed, 20 Feb 2019 04:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550666739; cv=none; d=google.com; s=arc-20160816; b=y9kcCsIVGKvNxql41tcI0nsITAM6Blr/QguDjp2fbIP6eNpI9euwaw8neITFQ0Oe97 mdcj2kIRqcvVykg0nX0P6DEgq8cN6Tmn0Gma59i3LNhx1iCxcptk7Qg3322Rm6ZMfpET CFCyaLXkXPV9N0t8tOEBQr412K0b2oQJULU0TISNoDPgdVEHmsUE/Z/A79Pwe3Mv6rKT TZa7qIqroQaU3FiRLU1lPKtrEInL62o7TzHH9ISMHZzBnANXnRyic0tizFuckbJMeOyG r1VBlrRCm3F7g4ef66A+6cRrNGDch48NF7L3ROOoUyFCb4nMi7MieKY0gubysUy7AhTl 9UAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=5gXqyUm+MzCzLQAxtw4op9wk2PcKOTUHWZhWJctI3Io=; b=BfSecqYgXSh1+DO4A//29rN8zvz8qVSkYZPvLOQTWAo+wI/XZ1NIrlQNDSJm+7Tff9 7CtrkcVWuhOpSCqin4f2il/M/PxOYxeOe8eukVHZr9kfmPn2dCbKVKEENEEoQdZiNQUq rRv9YZCm6Ev8lWXnJTvZ0kjdL6xfHH0gxsEV4Fc6iAyYD2BqfCLa5stemonNwFzxlwdo HLpCfoA/z96BkU0MIbEXOYI1RUgGn+E5SOAxPRq9VmqWCD2B5LFH4DQ/iEmZHatUVaN+ HEEhF0seX4rzz8YT0B/CeZLDYSOfpA9V0hKztk0A0h+SghouqgBBybktOayNy0+aYm1r /PUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=suBfKTep; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o13sor13122034wru.8.2019.02.20.04.45.39 for (Google Transport Security); Wed, 20 Feb 2019 04:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=suBfKTep; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5gXqyUm+MzCzLQAxtw4op9wk2PcKOTUHWZhWJctI3Io=; b=suBfKTephxFP+rdqh9QzczLioDwgZsNZldG4s1nh7aGfk3wEFGpQ9PdSDS4yHWIosW CMz20JglknTgOIjfFaO6roeZJLwS6nLkve4A+CU0cKn5/n6inOXbO8dUd/xaDNCAek4F tDeqCMVMbJKNwhs6EecZjBmaYm/Yp05RlUwygtOpM1f2LSgsjrBjZZoGHSB1LSNAGCK2 4uf9Fz5a1JhRTnz3HG1hCsgB9zV/ddcZyEYrtEcLI9hJKqzm/UlPsvhTyJm26nhpFmp8 TqGNgiwm6KIeqMLVLNEIJW0jx+xZ8bnGjcVsAnKBF2yR5LJTxVtp1R2NZmooih+lSqjF OXKw== X-Google-Smtp-Source: AHgI3IaJRu9aCw0ZFP+B3NmgwPZu8apybwshVX27xoQP+MZRDazR203qivIq48ZC/KUV1m1/OgKHcg== X-Received: by 2002:adf:de83:: with SMTP id w3mr23532379wrl.56.1550666738752; Wed, 20 Feb 2019 04:45:38 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:13:8ce:d7fa:9f4c:492]) by smtp.gmail.com with ESMTPSA id f196sm6378889wme.36.2019.02.20.04.45.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 04:45:37 -0800 (PST) From: Andrey Konovalov To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Qian Cai , Vincenzo Frascino , Kostya Serebryany , Evgeniy Stepanov , Andrey Konovalov Subject: [PATCH 4/4] kasan, slab: remove redundant kasan_slab_alloc hooks Date: Wed, 20 Feb 2019 13:45:29 +0100 Message-Id: <4ca1655cdcfc4379c49c50f7bf80f81c4ad01485.1550602886.git.andreyknvl@google.com> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> References: <9c4c3ce5ccfb894c7fe66d91de7c1da2787b4da4.1550602886.git.andreyknvl@google.com> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP kasan_slab_alloc() calls in kmem_cache_alloc() and kmem_cache_alloc_node() are redundant as they are already called via slab_alloc/slab_alloc_node()-> slab_post_alloc_hook()->kasan_slab_alloc(). Remove them. Signed-off-by: Andrey Konovalov --- mm/slab.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 4ad95fcb1686..91c1863df93d 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3547,7 +3547,6 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) { void *ret = slab_alloc(cachep, flags, _RET_IP_); - ret = kasan_slab_alloc(cachep, ret, flags); trace_kmem_cache_alloc(_RET_IP_, ret, cachep->object_size, cachep->size, flags); @@ -3637,7 +3636,6 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid) { void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_); - ret = kasan_slab_alloc(cachep, ret, flags); trace_kmem_cache_alloc_node(_RET_IP_, ret, cachep->object_size, cachep->size, flags, nodeid);