mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
parser: add rttime rlimit support
This patch adds support for the rttime rlimit (aka RLIMIT_RTTIME), available since the 2.6.25 kernel, according to the getrlimit(2) man page; see that man page for more details on this rlimit. An acceptance test is also added, as well as an update to the apparmor.vim input template. While reviewing to see what made sense in apparmor.vim for the rttime rlimit, I discovered that RLIMIT_RTTIME's units are microseconds, not seconds like RLIMIT_CPU (according to the setrlimit(2) manpage). This necessitated not sharing the case switch with RLIMIT_CPU. I didn't add a keyword for microseconds, but I did for milliseconds. I also don't accept any unit larger than minutes, as it didn't seem appropriate (and even minutes felt... gratuitous). I would appreciate feedback on what keywords would be useful here. Patch History: v1: initial submission v2: - add apparmor.vim support for rttime keyword - adjust RLIMIT_TIME value assignment due to its units being microseconds, not seconds, and add milliseconds keyword. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -174,6 +174,9 @@ static struct keyword_table rlimit_table[] = {
|
||||
#endif
|
||||
#ifdef RLIMIT_RTPRIO
|
||||
{"rtprio", RLIMIT_RTPRIO},
|
||||
#endif
|
||||
#ifdef RLIMIT_RTTIME
|
||||
{"rttime", RLIMIT_RTTIME},
|
||||
#endif
|
||||
/* terminate */
|
||||
{NULL, 0}
|
||||
|
Reference in New Issue
Block a user