From patchwork Mon Jan 25 18:39:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 372389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AA82C433E6 for ; Tue, 26 Jan 2021 21:13:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF20822B3B for ; Tue, 26 Jan 2021 21:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728708AbhAZEvc (ORCPT ); Mon, 25 Jan 2021 23:51:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:33594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730561AbhAYSrC (ORCPT ); Mon, 25 Jan 2021 13:47:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4AD9206FA; Mon, 25 Jan 2021 18:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611600404; bh=nhrx6W/B1kqDHdQVYj2FYcVbucmV2fIBWUSyBQxzwqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rcSTdkxd21eOC/tTpvK7v8C2m2XJWJhLRarreEnhECyH1sH+jsQDpgXAt0F5n3IkA n4mUsm7cl4V5+6OJ5YtJWqXLFIhV2rq2Rp2tAwwX6UvPUQZhk1+z1d5ln+fIi3kdMC KIJatGQkeXEWWcKL6l25j/Yjgnlx1fJW71JkWT0w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lecopzer Chen , Andrey Konovalov , Andrey Ryabinin , Dan Williams , Dmitry Vyukov , Alexander Potapenko , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 76/86] kasan: fix incorrect arguments passing in kasan_add_zero_shadow Date: Mon, 25 Jan 2021 19:39:58 +0100 Message-Id: <20210125183204.264064782@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125183201.024962206@linuxfoundation.org> References: <20210125183201.024962206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lecopzer Chen commit 5dabd1712cd056814f9ab15f1d68157ceb04e741 upstream. kasan_remove_zero_shadow() shall use original virtual address, start and size, instead of shadow address. Link: https://lkml.kernel.org/r/20210103063847.5963-1-lecopzer@gmail.com Fixes: 0207df4fa1a86 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN") Signed-off-by: Lecopzer Chen Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dan Williams Cc: Dmitry Vyukov Cc: Alexander Potapenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/kasan/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/mm/kasan/init.c +++ b/mm/kasan/init.c @@ -503,7 +503,6 @@ int kasan_add_zero_shadow(void *start, u 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; }