mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: implement memzero_explicit()
Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D44586 (cherry picked from commit 218b2ccf8cc90698487515c681f3e3453b0dcead)
This commit is contained in:
parent
0af78fa479
commit
7a52baf280
1 changed files with 7 additions and 0 deletions
|
|
@ -273,4 +273,11 @@ memcpy_and_pad(void *dst, size_t dstlen, const void *src, size_t len, int ch)
|
|||
memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \
|
||||
})
|
||||
|
||||
static inline void
|
||||
memzero_explicit(void *p, size_t s)
|
||||
{
|
||||
memset(p, 0, s);
|
||||
__asm__ __volatile__("": :"r"(p) :"memory");
|
||||
}
|
||||
|
||||
#endif /* _LINUXKPI_LINUX_STRING_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue