OSDN Git Service

selinux: Avoid dynamic memory allocation for small context buffers
authorSultan Alsawaf <sultan@kerneltoast.com>
Wed, 31 Jul 2019 04:13:43 +0000 (21:13 -0700)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 10:22:18 +0000 (18:22 +0800)
commitbed6055f68f4ed2fd615522295fc5bdbaec9f930
treed3cf838d6196b5b3c21a6a5a4c8d42872d4051e4
parenta8641f089621749394a74f34f372589733a47ce8
selinux: Avoid dynamic memory allocation for small context buffers

Most context buffers are rather small and can fit on the stack,
eliminating the need to allocate them dynamically. Reserve a 4 KiB
stack buffer for this purpose to avoid the overhead of dynamic
memory allocation.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
security/selinux/hooks.c