Skip to content

Commit

Permalink
IMA: handle whitespace better
Browse files Browse the repository at this point in the history
IMA parser will fail if whitespace is used in any way other than a single
space.  Using a tab or even using 2 spaces in a row will result in a policy
being rejected.  This patch makes the kernel ignore whitespace a bit better.

Signed-off-by: Eric Paris <[email protected]>
Acked-by: Mimi Zohar <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
eparis authored and James Morris committed Apr 20, 2010
1 parent e9d393b commit 28ef400
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions security/integrity/ima/ima_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ static int ima_parse_rule(char *rule, struct ima_measure_rule_entry *entry)

entry->uid = -1;
entry->action = UNKNOWN;
while ((p = strsep(&rule, " ")) != NULL) {
while ((p = strsep(&rule, " \t")) != NULL) {
substring_t args[MAX_OPT_ARGS];
int token;
unsigned long lnum;

if (result < 0)
break;
if (!*p)
break;
if ((*p == '\0') || (*p == ' ') || (*p == '\t'))
continue;
token = match_token(p, policy_tokens, args);
switch (token) {
case Opt_measure:
Expand Down

0 comments on commit 28ef400

Please sign in to comment.