git: 1a045267a3e5 - stable/14 - LinuxKPI: Add want_init_on_free to linux/mm.h

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Thu, 01 Aug 2024 22:27:31 UTC
The branch stable/14 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=1a045267a3e5fa3c6aba879cde5a860d1e467421

commit 1a045267a3e5fa3c6aba879cde5a860d1e467421
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2024-04-08 06:47:43 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-08-01 21:09:39 +0000

    LinuxKPI: Add want_init_on_free to linux/mm.h
    
    want_init_on_free returns if heap memory zeroing on free is enabled.
    FreeBSD does not zeroes heap memory on free().
    
    Sponsored by:   Serenity Cyber Security
    Reviewed by:    emaste
    MFC after:      1 week
    
    (cherry picked from commit 56041ee817fff844e5b2de7eedc447e388ab988e)
---
 sys/compat/linuxkpi/common/include/linux/mm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
index 0030cc6fb7a9..109bfffe7d6a 100644
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -382,4 +382,10 @@ might_alloc(gfp_t gfp_mask __unused)
 
 #define	is_cow_mapping(flags)	(false)
 
+static inline bool
+want_init_on_free(void)
+{
+	return (false);
+}
+
 #endif					/* _LINUXKPI_LINUX_MM_H_ */