mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
ZIO: Add overflow checks for linear buffers
Since we use a limited set of kmem caches, quite often we have unused memory after the end of the buffer. Put there up to a 512-byte canary when built with debug to detect buffer overflows at the free time. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15553
This commit is contained in:
committed by
Brian Behlendorf
parent
ad47eca195
commit
e48195c816
@@ -64,6 +64,9 @@ libspl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
#undef verify
|
||||
#endif
|
||||
|
||||
#define PANIC(fmt, a...) \
|
||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
||||
|
||||
#define VERIFY(cond) \
|
||||
(void) ((!(cond)) && \
|
||||
libspl_assert(#cond, __FILE__, __FUNCTION__, __LINE__))
|
||||
|
||||
Reference in New Issue
Block a user