Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp279450pxm; Wed, 2 Mar 2022 15:16:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkbSVGa2T8/F9NBmqb3hq1ALgOSHqJeeDO49/eK46+9GffpxVc5yBz5F5Lv6d7RQYmGBdU X-Received: by 2002:a05:6a00:b92:b0:4f1:4b2:737f with SMTP id g18-20020a056a000b9200b004f104b2737fmr35389849pfj.31.1646263009870; Wed, 02 Mar 2022 15:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646263009; cv=none; d=google.com; s=arc-20160816; b=xTYWOrion2E5uak3oybF769OM8eHqkJA2rgfnpwyqK8hWb6sQ9aVJprn6gVegxf6Kb 7HA/xCu1XW3qn135NGI1NyVZcZJzfV+Qda0mnbh05TCnOFd5F5ePILn7Mj5vg4O9lW1j 8cFO4pLp1kQo711Nj1+KGc8Remj/hkQJ2rwCpbl6zk6z2ZE6KsW+v7Fq2VkpZGH6Gamf SAGjF+jMqoKFwA1r9D6KTUMMJ1Qw8pY9R1kbgBX4gkNV/bk6NW6PjrNKFjonedU2bipP ttzF/H6L1obnRFWdppVfy7GgNRwHRSzPyct87K/Xker1Mg0htbK51ZtdLWmRfpMSSCLw ifHw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M062mhOVYVf9bJIp01ZOeX3qpFJNVUV/wAEZA8I272E=; b=qEY/d9BHSTVzfpH6/J4AJlp70yvxk57rYFIvUHJqHaxQUxp4gsS0CpoFBrKHokfgYx 9QMdww5unDGw27fDx7/VmUTxy2HkRrkKzjddenYICeZbk3arv2/ZtSD3L9VLr18o3B09 2xp2jfiZXHyz3n70joxG9fGNu53taSEZBernEq9T8McaFbt+HVkCvlT4BRil5uIKOksQ IDewX5XjS9o7ihzxOsGLBX/a90SpGWqTCSlCk3BmM3+NW5U+v+I56IA/O9yDaYbkT9Aq CO0HPycHeU9lpgiaT5AST0U+ooY+pN7zGx490/1XQb8KGFybm8tDibN5Waf/qzkVtoOI Pg6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lH9wtAh7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 11-20020a630e4b000000b0037476073f86si333297pgo.831.2022.03.02.15.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:16:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lH9wtAh7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5A814A9A68; Wed, 2 Mar 2022 14:53:51 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241508AbiCBQjt (ORCPT + 99 others); Wed, 2 Mar 2022 11:39:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236919AbiCBQjn (ORCPT ); Wed, 2 Mar 2022 11:39:43 -0500 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB5431369 for ; Wed, 2 Mar 2022 08:38:59 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1646239138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M062mhOVYVf9bJIp01ZOeX3qpFJNVUV/wAEZA8I272E=; b=lH9wtAh7UDSWF/e9AczfTV9enN4uq/JJvUnkvS3JD5lO39CTU8KgFlOa8XuaMRO5OBz/Rk +Gte5syiG2TrYhFZ5NuL2BGI/f9VgTmWVR+r0hvmFWvNp9TqUusWNQXJrSNdKo9w9VVizH pDmUp3Zb0WD+KB7MoptfkaUEEtwc450= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm 14/22] kasan: merge __kasan_report into kasan_report Date: Wed, 2 Mar 2022 17:36:34 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov Merge __kasan_report() into kasan_report(). The code is simple enough to be readable without the __kasan_report() helper. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 41c7966451e3..56d5ba235542 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -435,37 +435,31 @@ static void print_report(struct kasan_access_info *info) } } -static void __kasan_report(void *addr, size_t size, bool is_write, - unsigned long ip) -{ - struct kasan_access_info info; - unsigned long flags; - - start_report(&flags, true); - - info.access_addr = addr; - info.first_bad_addr = kasan_find_first_bad_addr(addr, size); - info.access_size = size; - info.is_write = is_write; - info.ip = ip; - - print_report(&info); - - end_report(&flags, addr); -} - bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip) { - unsigned long ua_flags = user_access_save(); bool ret = true; + void *ptr = (void *)addr; + unsigned long ua_flags = user_access_save(); + unsigned long irq_flags; + struct kasan_access_info info; if (unlikely(!report_enabled())) { ret = false; goto out; } - __kasan_report((void *)addr, size, is_write, ip); + start_report(&irq_flags, true); + + info.access_addr = ptr; + info.first_bad_addr = kasan_find_first_bad_addr(ptr, size); + info.access_size = size; + info.is_write = is_write; + info.ip = ip; + + print_report(&info); + + end_report(&irq_flags, ptr); out: user_access_restore(ua_flags); -- 2.25.1