Skip to content

lua-lsm: don't store filp_open errors in file userdata#11

Open
chenzongyao200127 wants to merge 2 commits into
openanolis:lua-lsmfrom
chenzongyao200127:lua-lsm-da2dbb5-file-userdata-errptr
Open

lua-lsm: don't store filp_open errors in file userdata#11
chenzongyao200127 wants to merge 2 commits into
openanolis:lua-lsmfrom
chenzongyao200127:lua-lsm-da2dbb5-file-userdata-errptr

Conversation

@chenzongyao200127
Copy link
Copy Markdown
Collaborator

filp_open() can return ERR_PTR(). Keep that value out of the GC-backed userdata so meth_file_gc() never passes an error pointer to fput().

Store the file pointer in a temporary first and publish it to the userdata only after the open succeeds.

Validation:

  • ./scripts/checkpatch.pl --git origin/lua-lsm..lua-lsm-da2dbb5-file-userdata-errptr
  • git diff --check origin/lua-lsm..lua-lsm-da2dbb5-file-userdata-errptr

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>
filp_open() can return ERR_PTR(). Keep that value out of the GC-backed
userdata so meth_file_gc() never passes an error pointer to fput().

Store the file pointer in a temporary first and publish it to the
userdata only after the open succeeds.

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