Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp509971pxb; Fri, 8 Jan 2021 10:28:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyChJLZTnCcG71FSjB6R7iAh1eC4fT+dmxelIBDwzGs8iLt6oiJ/vsVyqMkqAwpcUbSL0ec X-Received: by 2002:a17:906:e250:: with SMTP id gq16mr3364690ejb.382.1610130481678; Fri, 08 Jan 2021 10:28:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610130481; cv=none; d=google.com; s=arc-20160816; b=MRAU+K8hYOZ3SVyCO0ErXxmgVn2uDlJOaXnaKUrYGl+DN6JvxVcqAfH6dSKShWVdUV VDUBzsrOdK3kWf/C+l/gKOeXwbqFs6phwztXxcu+/DO0P/iECqbvzokmuAJFG9T7wB/F ZkG1kYHGslpHLJc+Ic4UjJXPS6xHadN9quwYJag/Ri0lqbvNlp/TNiFUKWdPabF6irYr R2QsQozN0WcYYyNTPLxIRmgfzS7OiejhlReGipW5dhjz19KzXinGjgnkTkoivM/BEit9 pFOrxZnGboGbiHRUUwkYC3wyr6ctrn9GsUVkbGtNohVYYMjSIURSnrJeB9jZLl/cQ46u UTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TvvXV7bEAAhRZbN5Xzp/cblWdK/NVPGWOn4od85Z6/w=; b=IHvdSiZvLNteCaYcq4ugUAz+KLAVylHorozJw1U0+MEjCdtQjqjtq+C6k89x4z9ymQ DT9VFcZwi28by+B+5R2uk+DjU41g0DYg+p6SFyiVYgn1MGHBOYdE4pC9Q4ZKkhwVOMI/ ntAoVsiKItNTTIGU/eHN6BOuVOigdYUMq8NJN+NsIB5rwuvuMF/neHuCZfmYFV6Gfv26 Etjv1NKcmjqnuJIOrifWje6qNxswUR3Oqj9VMXm0KpXyRayq78oA9QRU3fRNAdE3AN8y EBtp4dJtV79kqnZgWK2UihuDyTPqGDf8/mXrYJRooeMpcc3ONUKm7/2+5VpwrKV1b689 QnMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=d+L+HGQn; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si3860349edq.377.2021.01.08.10.27.37; Fri, 08 Jan 2021 10:28:01 -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=@google.com header.s=20161025 header.b=d+L+HGQn; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728457AbhAHS0U (ORCPT + 99 others); Fri, 8 Jan 2021 13:26:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbhAHS0U (ORCPT ); Fri, 8 Jan 2021 13:26:20 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38FE8C061380 for ; Fri, 8 Jan 2021 10:25:40 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id x18so6089530pln.6 for ; Fri, 08 Jan 2021 10:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TvvXV7bEAAhRZbN5Xzp/cblWdK/NVPGWOn4od85Z6/w=; b=d+L+HGQnJ8GkivLJcq4DSA2uJmUEaepv00NVO6HXnXJPKMFc+PtcXC1FqGYoEuOMyT s0pXM7/rVZSEDTRSIpT0t7Rd5Ha5ua5EkBbHlDLbrV82y4x5LFvv9+DKrxf2mNewLhOA oGwdlDMpLGuBuvDgbAgAeHZWF4BmA3bl/h5vs5xK9x43q3QakNcdeCuV+Edzegzk8S3f XLZDkOrFMrItw47dJOMCaGb0qkDDVq8mYsC6UXU0Z9t0t09FLfNAqWiikYHfXz6MSSBq 4GKoC01+QiIWSjcxFl8QSUjD9ZlV+xv8AnZlaqcp4j+Jdg9qGFXMYI3dAmqV8mLxDtVQ z4pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TvvXV7bEAAhRZbN5Xzp/cblWdK/NVPGWOn4od85Z6/w=; b=N2k/gN7qbfQct4S8jiKvC490dVE8fu46bv4wMMR4gp/bOo4AcjUbdvDKfPhsx+bDcW L9SnE69SZXlYR59kUvAkZAdePqLS2Ye563wf73/N4FgR7pipXbLmeJVJtxqA/9VIXLFq Ohk+NBo2oKd+Iy77sEJT7/atUA3H1ZZq8Ann4mK07fUU5X+3TlHs9ZTz5qG2jYiqlext ZUttbBMTfxJQyp9HE7tCaZ6G7oayENTyyXPGezo/7XdGfPO1IqsjMNrdHt3H/kfOV22k LOxLf5SJPIWVsGeWskv4lj0oZRUDRJB/vCoBlDcA6ODYIFFtr9nIk9gHf1JXzEBHFaOh yY2w== X-Gm-Message-State: AOAM533Xekv6HMDtrQiHWVZ0zU8+6k/utTdAziVRCk9VVe3/087a+4Bd Qj49XweOKj4MP5VRFvjUNiDcxcGbFaJPfwIGnSeg3g== X-Received: by 2002:a17:902:9009:b029:dc:52a6:575 with SMTP id a9-20020a1709029009b02900dc52a60575mr4902482plp.57.1610130339630; Fri, 08 Jan 2021 10:25:39 -0800 (PST) MIME-Version: 1.0 References: <20210103063847.5963-1-lecopzer@gmail.com> In-Reply-To: <20210103063847.5963-1-lecopzer@gmail.com> From: Andrey Konovalov Date: Fri, 8 Jan 2021 19:25:28 +0100 Message-ID: Subject: Re: [PATCH] kasan: fix incorrect arguments passing in kasan_add_zero_shadow To: Lecopzer Chen Cc: LKML , Linux Memory Management List , kasan-dev , Dan Williams , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , linux-mediatek@lists.infradead.org, yj.chiang@mediatek.com, Lecopzer Chen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 3, 2021 at 7:39 AM Lecopzer Chen wrote: > > 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 Reviewed-by: Andrey Konovalov