Message ID | 20230208164011.2287122-3-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3560221wrn; Wed, 8 Feb 2023 08:42:44 -0800 (PST) X-Google-Smtp-Source: AK7set9H1o6yO6VNLhL1ZxeyoycOe0NJ+RW20fQAyz5NsVR8vLfbtqzswRNz5mPvqLRw8oFQYbDa X-Received: by 2002:a62:828c:0:b0:5a8:4d93:8864 with SMTP id w134-20020a62828c000000b005a84d938864mr618518pfd.3.1675874563831; Wed, 08 Feb 2023 08:42:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675874563; cv=none; d=google.com; s=arc-20160816; b=PnOj+qB2bSKlaG6ta9OxF/M+mlrHBBCzmWiL/t/pPVtflqgx6ss3l+CHXSmGt097Nc wfRYFYV8bFR8NtpBb4rW0Czkj2lSJ7Z4jKLMqyk53dDBbJiQYITlfMQszJiEkbZm8MVP UntOpjQkAzANGBDY+WRBSbOGbDqs1/u39r+1z33SL5FghBkXijZa/g2YqrDRkGMzya41 jhIq92Po2755w0bwUY6+psQcUKwH8lA3di7fexnHYwxk5cg2gmpnYkFjQs9DJEDXqDYb o7qJGYB0NN6LDSLuIktnRlqVGpux/esHWuZrAL87z3oLyp15YVbFfCHQdD5qgS1cJ/Ak MXMg== 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=jF2tD5+GeZfdR+u2uMsmszDgDaCRZ/+kDNXUB3+Ta/s=; b=gzfr/43Z49/hxbaKdZ3dAqZJQoFiIxDC6IMa2FqFhshtTT35hXCRm3x1xMLUMlS6/q P7R6LjK56+BchLxPUWxL+96ZNj6kl5wbXm3UsIB9beay5bQrow/znGllCZBFCTqH276A xm5Qqia13v1R3bcCgMJ7Un0MYKMy8IqcyuX+3AgZ7TF9tJSG92QNPAewPa6cWvplmIfw e7QlCZQ3qhjAHSXAITt0+GwNFKEgWPd0LxBl4yfyk/mtQmm16AU/H96VrZ5sOwmauo5F GdE9KFDoTH1NeiIyZrhDT3cRQjQC5MKo98le5aIpqP4hg8zjBXeNrUTRYteYL8hZsLuH DMbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ewkkWjBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 186-20020a6218c3000000b0057509d0411esi18242685pfy.192.2023.02.08.08.42.30; Wed, 08 Feb 2023 08:42:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ewkkWjBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjBHQlI (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Wed, 8 Feb 2023 11:41:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231644AbjBHQkh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Feb 2023 11:40:37 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701D74DE00 for <linux-kernel@vger.kernel.org>; Wed, 8 Feb 2023 08:40:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D09D61734 for <linux-kernel@vger.kernel.org>; Wed, 8 Feb 2023 16:40:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B31C433EF; Wed, 8 Feb 2023 16:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675874432; bh=GGeAEaRt65it3PXlOo+5hSPcgSq11pcqA9eKquHfzZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ewkkWjBPkbuENbTspA2LMFcdZN6Zua6IVR1vYYB/KD3R8+7kCWOzWIfI2C/nmkE3G zMm/o67vRk2/twf7DStLfKvMwqqsWuL0MN77JEipi6dwrltf0RiCyAWs5Wchgq0UjO rbO3uDttgAqTQeVRyfLfxxrAmoSQk+4BJqwIrjQ2gFvPeqWPypeJRxy+5AxKYMbpOx NDJMkTEda9UD98e1awEk2Hf054FJmvlaq83KvxIqVAUeYsOG52SOMXxSS3VXKE9YI5 iMzucZ84z3ZsxGPSIkYVCSmQug3Kh521Mo+qCZm1fRabb9tzLa7fOJvFKIwMUulRCE TioEaRvHFnyCQ== From: Arnd Bergmann <arnd@kernel.org> To: Josh Poimboeuf <jpoimboe@kernel.org>, Peter Zijlstra <peterz@infradead.org> Cc: kasan-dev@googlegroups.com, Marco Elver <elver@google.com>, Dmitry Vyukov <dvyukov@google.com>, Alexander Potapenko <glider@google.com>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, Vincenzo Frascino <vincenzo.frascino@arm.com>, Andrey Konovalov <andreyknvl@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@suse.de>, Miroslav Benes <mbenes@suse.cz>, Michael Ellerman <mpe@ellerman.id.au>, Sathvika Vasireddy <sv@linux.ibm.com>, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] objdump: add UACCESS exception for more stringops Date: Wed, 8 Feb 2023 17:39:57 +0100 Message-Id: <20230208164011.2287122-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208164011.2287122-1-arnd@kernel.org> References: <20230208164011.2287122-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757281846755804166?= X-GMAIL-MSGID: =?utf-8?q?1757281846755804166?= |
Series |
[1/4] kasan: mark addr_has_metadata __always_inline
|
|
Commit Message
Arnd Bergmann
Feb. 8, 2023, 4:39 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The memset/memmove/memcpy string functions are wrapped in different ways based on configuration. While the __asan_mem* functions already have exceptions, the ones called from those do not: mm/kasan/shadow.o: warning: objtool: __asan_memset+0x30: call to __memset() with UACCESS enabled mm/kasan/shadow.o: warning: objtool: __asan_memmove+0x51: call to __memmove() with UACCESS enabled mm/kasan/shadow.o: warning: objtool: __asan_memcpy+0x51: call to __memcpy() with UACCESS enabled vmlinux.o: warning: objtool: .altinstr_replacement+0x1406: call to memcpy_erms() with UACCESS enabled vmlinux.o: warning: objtool: .altinstr_replacement+0xed0: call to memset_erms() with UACCESS enabled vmlinux.o: warning: objtool: memset+0x4: call to memset_orig() with UACCESS enabled vmlinux.o: warning: objtool: memset+0x4: call to memset_orig() with UACCESS enabled Add these to the list as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- tools/objtool/check.c | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On Wed, Feb 08, 2023 at 05:39:57PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The memset/memmove/memcpy string functions are wrapped in different > ways based on configuration. While the __asan_mem* functions already > have exceptions, the ones called from those do not: > > mm/kasan/shadow.o: warning: objtool: __asan_memset+0x30: call to __memset() with UACCESS enabled > mm/kasan/shadow.o: warning: objtool: __asan_memmove+0x51: call to __memmove() with UACCESS enabled > mm/kasan/shadow.o: warning: objtool: __asan_memcpy+0x51: call to __memcpy() with UACCESS enabled > vmlinux.o: warning: objtool: .altinstr_replacement+0x1406: call to memcpy_erms() with UACCESS enabled > vmlinux.o: warning: objtool: .altinstr_replacement+0xed0: call to memset_erms() with UACCESS enabled > vmlinux.o: warning: objtool: memset+0x4: call to memset_orig() with UACCESS enabled > vmlinux.o: warning: objtool: memset+0x4: call to memset_orig() with UACCESS enabled > > Add these to the list as well. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > tools/objtool/check.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tools/objtool/check.c b/tools/objtool/check.c > index 0f67c6a8bc98..e8fb3bf7a2e3 100644 > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -1248,6 +1248,13 @@ static const char *uaccess_safe_builtin[] = { > "clear_user_erms", > "clear_user_rep_good", > "clear_user_original", > + "__memset", > + "__memcpy", > + "__memmove", > + "memset_erms", > + "memcpy_erms", > + "memset_orig", > + "memcpy_orig", > NULL > }; Hmm, I wanted to go the other way and remove __asan_mem*. https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=sched/core-robot&id=79cdfdacd5b8d1ac77e24ccbc178bba0294d0d78
On Wed, Feb 8, 2023, at 19:09, Peter Zijlstra wrote: > On Wed, Feb 08, 2023 at 05:39:57PM +0100, Arnd Bergmann wrote: > > Hmm, I wanted to go the other way and remove __asan_mem*. > > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=sched/core-robot&id=79cdfdacd5b8d1ac77e24ccbc178bba0294d0d78 Makes sense. I've put your patch into randconfig tree now, I'll let you know if that causes other problems. Arnd
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 0f67c6a8bc98..e8fb3bf7a2e3 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1248,6 +1248,13 @@ static const char *uaccess_safe_builtin[] = { "clear_user_erms", "clear_user_rep_good", "clear_user_original", + "__memset", + "__memcpy", + "__memmove", + "memset_erms", + "memcpy_erms", + "memset_orig", + "memcpy_orig", NULL };