forked from Qortal/Brooklyn
2a709f28fa
* 0day explit mitigation * Memory corruption prevention * Privilege escalation prevention * Buffer over flow prevention * File System corruption defense * Thread escape prevention This may very well be the most intensive inclusion to BrooklynR. This will not be part of an x86 suite nor it will be released as tool kit. The security core toolkit will remain part of kernel base.
24 lines
502 B
C
24 lines
502 B
C
#include <linux/kernel.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/grsecurity.h>
|
|
#include <linux/grinternal.h>
|
|
#include <linux/errno.h>
|
|
|
|
void
|
|
gr_log_forkfail(const int retval)
|
|
{
|
|
#ifdef CONFIG_GRKERNSEC_FORKFAIL
|
|
if (grsec_enable_forkfail && (retval == -EAGAIN || retval == -ENOMEM)) {
|
|
switch (retval) {
|
|
case -EAGAIN:
|
|
gr_log_str(GR_DONT_AUDIT, GR_FAILFORK_MSG, "EAGAIN");
|
|
break;
|
|
case -ENOMEM:
|
|
gr_log_str(GR_DONT_AUDIT, GR_FAILFORK_MSG, "ENOMEM");
|
|
break;
|
|
}
|
|
}
|
|
#endif
|
|
return;
|
|
}
|