One very useful feature is so-called slab poisoning. The term poisoning in this context implies poking memory with certain signature bytes or a pattern that is easily recognizable. The prerequisite to using this, though, is that the CONFIG_SLUB_DEBUG kernel configuration option is on. How can you check? Simple:
$ grep -w CONFIG_SLUB_DEBUG /boot/config-5.4.0-llkd01
CONFIG_SLUB_DEBUG=y
The =y seen in the preceding code indicates that it's indeed on. Now (assuming it's turned on) if you create a slab cache with the SLAB_POISON flag (we covered the creation of a slab cache in the Creating a custom slab cache section), then, when the memory is allocated, it's always initialized to the special value or memory pattern 0x5a5a5a5a – it's poisoned (it's quite intentional: the hex value 0x5a is the ASCII character Z for zero)! So, think about it, if you spot...