Skip to content

Commit 5799418

Browse files
blucajxwufan
authored andcommitted
ipe: return -ESTALE instead of -EINVAL on update when new policy has a lower version
When loading policies in userspace we want a recognizable error when an update attempts to use an old policy, as that is an error that needs to be treated differently from an invalid policy. Use -ESTALE as it is clear enough for an update mechanism. Signed-off-by: Luca Boccassi <[email protected]> Reviewed-by: Serge Hallyn <[email protected]> Signed-off-by: Fan Wu <[email protected]>
1 parent 8e929cb commit 5799418

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/ipe/policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int ipe_update_policy(struct inode *root, const char *text, size_t textlen,
107107
}
108108

109109
if (ver_to_u64(old) > ver_to_u64(new)) {
110-
rc = -EINVAL;
110+
rc = -ESTALE;
111111
goto err;
112112
}
113113

0 commit comments

Comments
 (0)