mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
rust: helpers: Add memchr wrapper for string operations
Add a dedicated string helper file with a memchr wrapper that uses the kernel's instrumented memchr() function to ensure KASAN and FORTIFY_SOURCE protections are preserved for Rust code. Reported-by: Miguel Ojeda <[email protected]> Link: https://lore.kernel.org/rust-for-linux/CANiq72mXAZc0sNM7ShX8VDVs_7zJddawP-e=wt+ERr1YUCcWUw@mail.gmail.com/ Signed-off-by: Jan Polensky <[email protected]> Acked-by: Heiko Carstens <[email protected]> Acked-by: Gary Guo <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
This commit is contained in:
1 parent
fc1118cdc3
commit
71247e71a4
2 files changed
+9
No files matched your search
@@ -88,6 +88,7 @@
|
||||
#include "signal.c"
|
||||
#include "slab.c"
|
||||
#include "spinlock.c"
|
||||
#include "string.c"
|
||||
#include "sync.c"
|
||||
#include "task.c"
|
||||
#include "time.c"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <linux/string.h>
|
||||
|
||||
__rust_helper void *rust_helper_memchr(const void *s, int c, size_t n)
|
||||
{
|
||||
return memchr(s, c, n);
|
||||
}
|
||||
Reference in new issue
Block a user