linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>,
	Sam Tebbs <sam.tebbs@arm.com>,
	Robin Murphy <robin.murphy@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Will Deacon <will@kernel.org>, Marco Elver <elver@google.com>
Subject: Re: [PATCH] kasan: fix build for CONFIG_KASAN_HW_TAGS
Date: Sat, 10 Jul 2021 21:16:14 +0200	[thread overview]
Message-ID: <CA+fCnZdHADek_3bFcLdkk7=XiRL25F0n6VaGGOrw-uUpDLxYYw@mail.gmail.com> (raw)
In-Reply-To: <20210708144411.25467-1-mark.rutland@arm.com>

On Thu, Jul 8, 2021 at 4:44 PM Mark Rutland <mark.rutland@arm.com> wrote:
>
> When CONFIG_KASAN_HW_TAGS is selected, <linux/kasan.h> uses _RET_IP_,
> but doesn't explicitly include <linux/kernel.h> where this is defined.
>
> We used to get this via a transitive include, but since commit:
>
>   f39650de687e3576 ("kernel.h: split out panic and oops helpers")
>
> ... this is no longer the case, and so we get a build failure:
>
> |   CC      arch/arm64/mm/kasan_init.o
> | In file included from arch/arm64/mm/kasan_init.c:10:
> | ./include/linux/kasan.h: In function 'kasan_slab_free':
> | ./include/linux/kasan.h:211:39: error: '_RET_IP_' undeclared (first use in this function)
> |   211 |   return __kasan_slab_free(s, object, _RET_IP_, init);
> |       |                                       ^~~~~~~~
> | ./include/linux/kasan.h:211:39: note: each undeclared identifier is reported only once for each function it appears in
> | ./include/linux/kasan.h: In function 'kasan_kfree_large':
> | ./include/linux/kasan.h:219:28: error: '_RET_IP_' undeclared (first use in this function)
> |   219 |   __kasan_kfree_large(ptr, _RET_IP_);
> |       |                            ^~~~~~~~
> | ./include/linux/kasan.h: In function 'kasan_slab_free_mempool':
> | ./include/linux/kasan.h:226:34: error: '_RET_IP_' undeclared (first use in this function)
> |   226 |   __kasan_slab_free_mempool(ptr, _RET_IP_);
> |       |                                  ^~~~~~~~
> | ./include/linux/kasan.h: In function 'kasan_check_byte':
> | ./include/linux/kasan.h:277:35: error: '_RET_IP_' undeclared (first use in this function)
> |   277 |   return __kasan_check_byte(addr, _RET_IP_);
> |       |                                   ^~~~~~~~
>
> Fix this by including <linux/kernel.h> explicitly.

Hi Mark,

Marco already sent a fix for this. It should be in the mm tree.
(Although the link to it in the Andrew's notification email doesn't
work. But they rarely do :)

> As a heads-up, there are some unrelated runtime issues with
> CONFIG_KASAN_HW_TAGS and the recent arm64 string routines rework, which
> I'm looking into now. If you boot-test with this applied, you should
> expect to see those.

+Sam, +Robin

Looks like the new strlen routine is making accesses past the allocated buffer.

The guilty commit is 325a1de81287 ("arm64: Import updated version of
Cortex Strings' strlen").

Thanks!

  reply	other threads:[~2021-07-10 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 14:44 [PATCH] kasan: fix build for CONFIG_KASAN_HW_TAGS Mark Rutland
2021-07-10 19:16 ` Andrey Konovalov [this message]
2021-07-12  8:37   ` Mark Rutland
2021-07-12  9:58   ` Will Deacon
2021-07-12 10:03     ` Marco Elver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+fCnZdHADek_3bFcLdkk7=XiRL25F0n6VaGGOrw-uUpDLxYYw@mail.gmail.com' \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sam.tebbs@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).