Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13025667pxu; Sat, 2 Jan 2021 22:42:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlfT7dMJ/OaO6BhJG0vE5RL1RAh3rhffmXiNrRGMteOkuUXwwjUmkB2c/1BC/GpupjHcCx X-Received: by 2002:a05:6402:3546:: with SMTP id f6mr41483804edd.242.1609656129763; Sat, 02 Jan 2021 22:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609656129; cv=none; d=google.com; s=arc-20160816; b=z/FztuORPizEUCqDyCvA4XRqRx3ExWiIbspq+T/3ufzNQN6JxSAZiI2nv7YrMBOV9f 5J8hmNmFqSu4wDdqzQmV5wSrLPHAAXnQIinKXQRh1yKmXhr+Y+YXZxh6+dTSBTvQSylY N5gUR5vI3ZzplvfeZi2GcIsaHYDZfJEjxrL6QZUwnHQ+edXaJM8cfgc3jRPdtPbV/X1h VxLa6dHmuhjF/dM3pIw6f8qojF18X/s4zG0+nat5MPOhaDHqbFvozWDoygKf7ja2CnSg b2LT2UMA7iufoXnGoskalJjeCa1gSnhzlLaBgjhfcgkWS/RPR/oesgNh4C2Q7d9OtzLb O2vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8Y92qT875d3aESyjMGQPzSpXc2nldV50acl7AIHo37A=; b=Zfs0KD6F5pW8kvQLdZNord4+w1qgJmWiUAYd/so7GgcUNJTD9jAdSmuzI/9PbQYhY9 EIJ3aE+Rjpsg8Swug1BHEbnJAbrvojqbmQyvNCpG3d5ZBugU85azMQKvtHAvZE+dqTWT tXr0MkhsuJqBJjrqs+lw8GNKudVgcLCS58Z7JBiOVLV9Pshf9qj2bXLcRfqH5/ikshLo gdWSmOD1YmcZKvQYGK5H2578sIx9ISJGIlnwZMaOwZbIIs4YXDx7QQm2QjZsIVDQx//7 NJwDXRXk1H7IiexTfmI+HdFa0obEBqvGTbeIvnaUBI4S6IVe7zO++64PnD2tW+4+kxHW UEEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aJfunVgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si27421473ejs.76.2021.01.02.22.41.46; Sat, 02 Jan 2021 22:42:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aJfunVgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726015AbhACGkC (ORCPT + 99 others); Sun, 3 Jan 2021 01:40:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbhACGkB (ORCPT ); Sun, 3 Jan 2021 01:40:01 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED94C061573 for ; Sat, 2 Jan 2021 22:39:21 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id w1so4224465pjc.0 for ; Sat, 02 Jan 2021 22:39:21 -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:mime-version :content-transfer-encoding; bh=8Y92qT875d3aESyjMGQPzSpXc2nldV50acl7AIHo37A=; b=aJfunVgtA594mdIlnY6+iNnEoN8EeUnwfZM2aPkYdnvOHH3TsUErBI7Jz/aEHkeKAg YDO24SvnsuqBYzWNWs/o4U1ECjAbxvGMehUJtorDvy66YtT6dn/1QpCHDIm7dYQyl0Gm kAFEWoKiLQQ33guOh+kaEgieAX3+hQtAlDZVVuGnxYueMxr5VYFOKMM8LKbOlkzvc4PT bTzVtJWh7+ZLEyR7HS2thgQPNaZzEV/FlqfNRV1dikf53koxYtgnx4kXyDObxjdQJM2N SDhi8evkkV/JdmzVSig6oB6Hk45tNP7VNaD5ac4/MEXgPOdNat+tMpNRHWzPrdJrQgws eePQ== 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:mime-version :content-transfer-encoding; bh=8Y92qT875d3aESyjMGQPzSpXc2nldV50acl7AIHo37A=; b=DjWXXuoBFkjb2trEgw7ZfsSgCWeY3G1HZ4oZ7kywRbsivvF26dlUxq3MmX8W2WdlBn cjE+CtTMt0dHkMUvDdtIH0ksCMebu3q8sR3xdmsDpumIbyxwEUprkoznbs/QkfgbjJrV rZdMOf96oc6gLeiU1mGJB2sNbybhnQQakVSmSvViNsCePR7pIimLZc6XSQEDHKEfdV3Y 3kYV+6n0ayKm/UB8KNFhBgTwGbFVgGp3WYFvxkNBNEpwv4qLYTs9RbfXlzku4DuIXrE9 pu4edeRbCDeUH8A5wHUhg5sdLmj3YSQf2Obh/xTSU2S1DKQujW6iDxUE2utJmC3gyRFK oP/A== X-Gm-Message-State: AOAM533k/+o6oHuLSw8NNG3sPrRJo49ZcHIA3+/Q4W4dxuMnXTpRA3uR 1dTg757kldvr9p/nJC9PtF47RZwbllI= X-Received: by 2002:a17:902:7086:b029:dc:8d:feab with SMTP id z6-20020a1709027086b02900dc008dfeabmr67602599plk.22.1609655960535; Sat, 02 Jan 2021 22:39:20 -0800 (PST) Received: from localhost.localdomain (61-230-37-4.dynamic-ip.hinet.net. [61.230.37.4]) by smtp.gmail.com with ESMTPSA id 73sm45465993pga.26.2021.01.02.22.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jan 2021 22:39:19 -0800 (PST) From: Lecopzer Chen To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com Cc: dan.j.williams@intel.com, aryabinin@virtuozzo.com, glider@google.com, dvyukov@google.com, akpm@linux-foundation.org, linux-mediatek@lists.infradead.org, yj.chiang@mediatek.com, Lecopzer Chen , Lecopzer Chen Subject: [PATCH] kasan: fix incorrect arguments passing in kasan_add_zero_shadow Date: Sun, 3 Jan 2021 14:38:47 +0800 Message-Id: <20210103063847.5963-1-lecopzer@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kasan_remove_zero_shadow() shall use original virtual address, start and size, instead of shadow address. Fixes: 0207df4fa1a86 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN") Signed-off-by: Lecopzer Chen --- mm/kasan/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/kasan/init.c b/mm/kasan/init.c index bc0ad208b3a7..67051cfae41c 100644 --- a/mm/kasan/init.c +++ b/mm/kasan/init.c @@ -481,7 +481,6 @@ int kasan_add_zero_shadow(void *start, unsigned long size) ret = kasan_populate_early_shadow(shadow_start, shadow_end); if (ret) - kasan_remove_zero_shadow(shadow_start, - size >> KASAN_SHADOW_SCALE_SHIFT); + kasan_remove_zero_shadow(start, size); return ret; } -- 2.25.1