From: Kees Cook <kees@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Rutland <mark.rutland@arm.com>,
David Gow <davidgow@google.com>,
Vitor Massaru Iha <vitor@massaru.org>,
Ivan Orlov <ivan.orlov0322@gmail.com>,
Brendan Higgins <brendan.higgins@linux.dev>,
Rae Moar <rmoar@google.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 1/2] kunit: test: Add vm_mmap() allocation resource manager
Date: Thu, 27 Jun 2024 12:51:40 -0700 [thread overview]
Message-ID: <202406271250.A227529@keescook> (raw)
In-Reply-To: <d32df98c-fd3c-466b-bc8f-47cec1c7bebf@roeck-us.net>
On Sat, Jun 22, 2024 at 06:47:39AM -0700, Guenter Roeck wrote:
> Hi,
>
> On Wed, Jun 12, 2024 at 12:59:18PM -0700, Kees Cook wrote:
> > For tests that need to allocate using vm_mmap() (e.g. usercopy and
> > execve), provide the interface to have the allocation tracked by KUnit
> > itself. This requires bringing up a placeholder userspace mm.
> >
> > This combines my earlier attempt at this with Mark Rutland's version[1].
> >
> > Normally alloc_mm() and arch_pick_mmap_layout() aren't exported for
> > modules, so export these only for KUnit testing.
> >
> > Link: https://lore.kernel.org/lkml/20230321122514.1743889-2-mark.rutland@arm.com/ [1]
>
> FWIW, not sure I understand what the above link has to do with this patch.
Both the above Link and this patch were implementing KUnit usercopy
tests (and the required infrastructure).
>
> > Co-developed-by: Mark Rutland <mark.rutland@arm.com>
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Reviewed-by: David Gow <davidgow@google.com>
> > Signed-off-by: Kees Cook <kees@kernel.org>
>
> This patch results in a build failure for nommu_kc705_defconfig if kunit tests
> are also enabled.
>
> ERROR: modpost: vmlinux: local symbol 'arch_pick_mmap_layout' was exported
>
> If CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=n, CONFIG_MMU=n, and
> CONFIG_KUNIT=y, arch_pick_mmap_layout is exported. However, if
> CONFIG_MMU=n, it is declared as static inline function.
I replied in the other thread too, but this has had a fix pending:
https://lore.kernel.org/lkml/202406271005.4E767DAE@keescook/
I pinged the patch again today.
-Kees
--
Kees Cook
next prev parent reply other threads:[~2024-06-27 19:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 19:59 [PATCH v3 0/2] usercopy: Convert test_user_copy to KUnit test Kees Cook
2024-06-12 19:59 ` [PATCH v3 1/2] kunit: test: Add vm_mmap() allocation resource manager Kees Cook
2024-06-22 13:47 ` Guenter Roeck
2024-06-27 19:51 ` Kees Cook [this message]
2024-06-12 19:59 ` [PATCH v3 2/2] usercopy: Convert test_user_copy to KUnit test Kees Cook
2024-06-14 15:50 ` Shuah Khan
2024-06-17 19:00 ` Kees Cook
2024-06-17 19:17 ` Shuah Khan
2024-06-19 18:38 ` Jeff Johnson
2024-06-19 20:35 ` Kees Cook
2024-06-13 4:41 ` [PATCH v3 0/2] " David Gow
2024-06-13 5:03 ` Kees Cook
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=202406271250.A227529@keescook \
--to=kees@kernel.org \
--cc=brendan.higgins@linux.dev \
--cc=davidgow@google.com \
--cc=gustavoars@kernel.org \
--cc=ivan.orlov0322@gmail.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=rmoar@google.com \
--cc=vitor@massaru.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.