lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250622112014.76bdd8929ecdb1c1fb3015b5@linux-foundation.org>
Date: Sun, 22 Jun 2025 11:20:14 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Sabyrzhan Tasbolatov <snovitoll@...il.com>
Cc: andreyknvl@...il.com, arnd@...db.de, david@...hat.com,
 dvyukov@...gle.com, elver@...gle.com, glider@...gle.com, hch@...radead.org,
 kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, ryabinin.a.a@...il.com, vincenzo.frascino@....com
Subject: Re: [PATCH v2] mm: unexport globally copy_to_kernel_nofault

On Sun, 22 Jun 2025 19:11:42 +0500 Sabyrzhan Tasbolatov <snovitoll@...il.com> wrote:

> `copy_to_kernel_nofault()` is an internal helper which should not be
> visible to loadable modules – exporting it would give exploit code a
> cheap oracle to probe kernel addresses.  Instead, keep the helper
> un-exported and compile the kunit case that exercises it only when
> `mm/kasan/kasan_test.o` is linked into vmlinux.

The recent 707f853d7fa3 ("module: Provide
EXPORT_SYMBOL_GPL_FOR_MODULES() helper") quietly added a thing which
might be useful here.  As far as I understand it, this will permit us
to export copy_to_kernel_nofault to kasan_test_c.o and to nothing else.

"might".  It depends on how "exploit code" might get hold of the
symbol.  Perhaps you/we can discuss this further.  Is the problem that
copy_to_kernel_nofault() is non-static?  Or it the problem that
"exploit code" is itself a kernel module?

In other words, a fuller investigation of how this export presently benefits
exploiters would help us understand how much
EXPORT_SYMBOL_GPL_FOR_MODULES() will improve the situation.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ