Skip to content

lua-lsm: validate numeric capability arguments#13

Open
chenzongyao200127 wants to merge 2 commits into
openanolis:lua-lsmfrom
chenzongyao200127:lua-lsm-22370f4-capability-arg-valid
Open

lua-lsm: validate numeric capability arguments#13
chenzongyao200127 wants to merge 2 commits into
openanolis:lua-lsmfrom
chenzongyao200127:lua-lsm-22370f4-capability-arg-valid

Conversation

@chenzongyao200127
Copy link
Copy Markdown
Collaborator

arg2cap() accepts capability names and numeric capability values. The name path resolves values from a fixed table, but the numeric path returned the Lua integer without checking that it names a valid capability.

Callers pass the result to helpers such as cap_raise(), cap_lower(), and cap_capable(). Reject invalid values in arg2cap() so Lua policy cannot drive capability helpers with out-of-range bit numbers.

Validation:

  • ./scripts/checkpatch.pl --git origin/lua-lsm..lua-lsm-22370f4-capability-arg-valid
  • git diff --check origin/lua-lsm..lua-lsm-22370f4-capability-arg-valid

Signed-off-by: Zongyao Chen ZongYao.Chen@linux.alibaba.com

* lua-lsm: validate inode_init_security xattr output
* lua-lsm: own inode_init_security xattr name storage
* lua-lsm: document OCFS2 xattr name lifetime issue

---------

Signed-off-by: Zongyao Chen <ZongYao.Chen@linux.alibaba.com>
arg2cap() accepts capability names and numeric capability values. The
name path resolves values from a fixed table, but the numeric path
returned the Lua integer without checking that it names a valid
capability.

Callers pass the result to helpers such as cap_raise(), cap_lower(),
and cap_capable(). Reject invalid values in arg2cap() so Lua policy
cannot drive capability helpers with out-of-range bit numbers.

Signed-off-by: Zongyao Chen <ZongYao.Chen@linux.alibaba.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant