From patchwork Mon Nov 23 20:14:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11926669 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 93523C388F9 for ; Mon, 23 Nov 2020 20:34:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24F2120715 for ; Mon, 23 Nov 2020 20:34:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2D7UxuZG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="mg4G1Did" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24F2120715 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T+kV42lKjdR38tXXZhfLR+d6xhOLZrNV2VYfxCoZl6A=; b=2D7UxuZGJWVh3JfQRzIs6rbEs pM2xTxcRxt9X3x79mfThU6dx0HwVciVGaxGbpXdKzt70D9WVMJHfDNn/KeaLfOEoGrzKRvs2qdWhX DFo1WA7wk3bkmCXasdGEbGc58puTrW5eRaBULzp1HT4vYzmxLiDD/0cNnBuHXHEyLSohJDWrY985L EXfYySDxi3plTeoQW9XRoGczlNPslDjVOD5zhKhnma4Hf7kliFjibm54rJscvjpa+BI9SrWUGsSR9 9gOq9sHTKy73K+5w/6FS1LaSQBTwboFBxc1ic2uWhpVCiUCd9cI2wBqGgJS2X2vCfqs59xlywci9+ dYJ3Ag0Wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIVs-0001Sa-UQ; Mon, 23 Nov 2020 20:32:41 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIF5-0002CX-0Z for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 20:15:31 +0000 Received: by mail-wm1-x349.google.com with SMTP id c131so167984wma.0 for ; Mon, 23 Nov 2020 12:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=p36dbwqSBkDo+5S2cwk7w2vFpTiM3nymWvjDRmhBFUI=; b=mg4G1DidJDofLGHNEBS3YNNpngVUCVymP5RWXDDdw2uRs9rVTEIaudcIuGM5F2q3L6 9Z/syptAsR65gevgGC7vb22jdpSpm8g2/OW2ZOv1TZ8ZvhRbz+eCh8+IZlSsYvvoSEaY KmtODUBNRhwsiEkBrfxHvAbyW7zWsjL/jwTAXPHFYAnzD1KOcF2q0gADTK7rF9nFZ+jO eOckU8kstaGbsmTJEnIYdXYtBuw6W4CSugEN2FyQtnaWvOQo7rNh2FHuR2TdgNawAkcz Xd/a751+eSOv37jt6hmeRkX2yJmLePmHNofrgvw4sRG3ClS9Zjoqb5Og50/dgojj1XOP Mbtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=p36dbwqSBkDo+5S2cwk7w2vFpTiM3nymWvjDRmhBFUI=; b=i2+KcBjON1HnSAbOlBKUheOBrddpBqVEkBUoneOcnCXvfuJ/OsoQl8e0pTN6NVwxDQ +R1E3274/aNoWQA+0sJXKsXKgzzmyfuHSmUk+1c1JG2ctQgxif9wnwXPEVrCQmceKP2i VR89UyALWGQV3oQb9f3Dns9Z1v0cFYA6hGRBHKuOH3Wjgaif7sNE1BtL25NJrj4kSppH ktK/jz/JKanzaDlNca5+QP90PPM6bUh59rvQNywJh3KRp2dJyNd0ggfBPVKy3L7kX3Be LmAMxL9ThSFVELpyc5bJy7BgQYpjlhjJMpdynO1NZ5+7VlPK5KHnbWY981xaBHmUCQrL dQZA== X-Gm-Message-State: AOAM532ym6n5Kdweeba5ukrqdmc7YKIMpNk35jVgmjbeCoQJywWmsqYe 8xCSjr59mKp9ngu3PPAO/mpDqUE70vmvBkcA X-Google-Smtp-Source: ABdhPJx/wpDE4yzZ0h+S0RGgypb3BniYNtoFo8y6Vex4DrXhWizpWxJCeQcvoYWSbeyWzTWTt6szgogxteJ0R7Gh X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:9d4c:: with SMTP id g73mr17209wme.127.1606162507547; Mon, 23 Nov 2020 12:15:07 -0800 (PST) Date: Mon, 23 Nov 2020 21:14:36 +0100 In-Reply-To: Message-Id: <93e78948704a42ea92f6248ff8a725613d721161.1606162397.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH mm v4 06/19] kasan: remove __kasan_unpoison_stack From: Andrey Konovalov To: Andrew Morton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_151519_188387_94566BF0 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Marco Elver , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There's no need for __kasan_unpoison_stack() helper, as it's only currently used in a single place. Removing it also removes unneeded arithmetic. No functional changes. Signed-off-by: Andrey Konovalov Reviewed-by: Dmitry Vyukov Reviewed-by: Marco Elver Link: https://linux-review.googlesource.com/id/Ie5ba549d445292fe629b4a96735e4034957bcc50 --- mm/kasan/common.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 7648a2452a01..fabd843eff3d 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -65,18 +65,12 @@ void kasan_unpoison_range(const void *address, size_t size) } #if CONFIG_KASAN_STACK -static void __kasan_unpoison_stack(struct task_struct *task, const void *sp) -{ - void *base = task_stack_page(task); - size_t size = sp - base; - - unpoison_range(base, size); -} - /* Unpoison the entire stack for a task. */ void kasan_unpoison_task_stack(struct task_struct *task) { - __kasan_unpoison_stack(task, task_stack_page(task) + THREAD_SIZE); + void *base = task_stack_page(task); + + unpoison_range(base, THREAD_SIZE); } /* Unpoison the stack for the current task beyond a watermark sp value. */