From patchwork Tue Nov 10 22:20:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11895649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C57B1391 for ; Tue, 10 Nov 2020 22:20:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 412A220674 for ; Tue, 10 Nov 2020 22:20:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ljjlpu85" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 412A220674 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C522C6B0083; Tue, 10 Nov 2020 17:20:45 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B3CD66B0085; Tue, 10 Nov 2020 17:20:45 -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 964DA6B0087; Tue, 10 Nov 2020 17:20:45 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0196.hostedemail.com [216.40.44.196]) by kanga.kvack.org (Postfix) with ESMTP id 57E866B0083 for ; Tue, 10 Nov 2020 17:20:45 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0825B8249980 for ; Tue, 10 Nov 2020 22:20:45 +0000 (UTC) X-FDA: 77469929250.13.house01_1d16fa3272f8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id DA8D018140B69 for ; Tue, 10 Nov 2020 22:20:44 +0000 (UTC) X-Spam-Summary: 1,0,0,258e49479b9218f8,d41d8cd98f00b204,3oxkrxwokcbaq3t7ue03b1w44w1u.s421y3ad-220bqs0.47w@flex--andreyknvl.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:967:968:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2525:2559:2563:2682:2685:2859:2902:2911:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3152:3352:3865:3870:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4425:5007:6261:6653:6742:7875:7903:8603:9025:9592:9969:10004:10400:11026:11473:11658:11914:12043:12114:12296:12297:12438:12555:12679:12895:12986:13069:13161:13229:13311:13357:14096:14097:14181:14394:14659:14721:14877:21080:21365:21444:21451:21627:21939:21990:30054,0,RBL:209.85.221.74:@flex--andreyknvl.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100;04yrx91gcpxgwsmaobx9kfqmpi543ycq1mfhrg3k4x4mcfx3ja1r11ktk4bzumf.g691bmcs3j19ey3estfi7wqrxk1ydqz1879cn4sd53hukq1kdpni m7g6p5cm X-HE-Tag: house01_1d16fa3272f8 X-Filterd-Recvd-Size: 4671 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 22:20:44 +0000 (UTC) Received: by mail-wr1-f74.google.com with SMTP id r15so1112576wrn.15 for ; Tue, 10 Nov 2020 14:20:44 -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=gyGUZGx6qFH2jkAU5L1Nk+VZLXl2e4B3h6WrDO5AJuc=; b=ljjlpu8510giM6ompwxwC9fW/XdFC8qbLxu53fZ6U03b6EYiKpJWB0pnDuMqHGR+jN r5TObzaeFfHiWBeyCqwixdqdi5C/59498RU2S9dfH8AcpG/uescXFFAI4vk1MFIFdUxs aKXAW+Igl/dpH9QlRqyELk9F5/tXGDupazh551//E9tyUg+sj67imZtPjKwh90Ayg1OS vnltrTuRHfB3/tkF78B29cR78uIqwsQ9sGY6GIW8WBL94NHckeVhPN4/F3EutOAkS+Ln 5/kQaGmI93yINQy4OgjBA4Oz+orNqVJURp3LVEBZBzBxMrSgh386MQ6eowcq/tXep6fs h8og== 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=gyGUZGx6qFH2jkAU5L1Nk+VZLXl2e4B3h6WrDO5AJuc=; b=PjfkHFm+Ej58+Flpu3yfJgAycPimfk7p8J40jF+/+NlluNYOExGLdFLfF99D3V/eAx /VuStZzQV18+ISpi8bIsNpc0t+bVhqK7aefhaulfUIz1Fkb2CcaVLd2Q67HfMzzJl/// oZMb0BwWcyeycBeT5u36utyYnYAdu6Dd8Hb2MVO2X2SAfUvKeszh8mEyzlvhDssSc7Tq IDEvgMtDk2CbulNsNBhxI5e5/Sj20Z0YxBsAHiMf424t9TO0pZ6hAWFsysfN3lurMwa+ aNlwanQ5gETkfeHnv73Cz8qo0WBUsSluFqzAQ2QjEUkX/fwTnHvY+UeUtFU6d/BKpdgD QO5Q== X-Gm-Message-State: AOAM532aiohhT0/MnuIinrRUvHqNsBPnUtO8c8EPXicimB8Y5I0MpxEG XglUJKnjqtYieRDf76yyzcp5lcRTMFgAOfid X-Google-Smtp-Source: ABdhPJwekepriFSyzIoCXRNKCGpvFiq2NnAR4bAyn052jaQHzEPlcFfRQSyz8Y0DdueqyddIpnCAMwTZ+WqCAiQP X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a5d:630b:: with SMTP id i11mr5840517wru.404.1605046843285; Tue, 10 Nov 2020 14:20:43 -0800 (PST) Date: Tue, 10 Nov 2020 23:20:10 +0100 In-Reply-To: Message-Id: <462c375f39ba8c4c105b3a9bf3b5db17f3720159.1605046662.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v2 06/20] kasan: remove __kasan_unpoison_stack From: Andrey Konovalov To: Dmitry Vyukov , Alexander Potapenko , Marco Elver Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov 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: 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 Link: https://linux-review.googlesource.com/id/Ie5ba549d445292fe629b4a96735e4034957bcc50 Reviewed-by: Marco Elver --- 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 a3e67d49b893..9008fc6b0810 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -59,18 +59,12 @@ void kasan_disable_current(void) #endif /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ #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; - - kasan_unpoison_memory(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); + + kasan_unpoison_memory(base, THREAD_SIZE); } /* Unpoison the stack for the current task beyond a watermark sp value. */