Commit dc46db78 authored by Paul Moore's avatar Paul Moore

lsm: cleanup the size counters in security_getselfattr()

Zero out all of the size counters in the -E2BIG case (buffer too
small) to help make the current code a bit more robust in the face of
future code changes.
Acked-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Reviewed-by: default avatarMickaël Salaün <mic@digikod.net>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent aab30be0
......@@ -3950,8 +3950,9 @@ int security_getselfattr(unsigned int attr, struct lsm_ctx __user *uctx,
continue;
}
if (rc == -E2BIG) {
toobig = true;
rc = 0;
left = 0;
toobig = true;
} else if (rc < 0)
return rc;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment