Skip to content

fix: replace assert() with error reply in hello_ll xattr handlers (issue #836)#8

Open
ShukantPal wants to merge 2 commits intomasterfrom
fix/issue-836
Open

fix: replace assert() with error reply in hello_ll xattr handlers (issue #836)#8
ShukantPal wants to merge 2 commits intomasterfrom
fix/issue-836

Conversation

@ShukantPal
Copy link
Copy Markdown
Owner

The hello_ll example crashed when getxattr/setxattr/removexattr were
called for unexpected inodes, because assert() would abort the process.
The kernel can invoke xattr operations for any inode, so replace asserts
with proper fuse_reply_err() calls that gracefully return ENODATA or
ENOTSUP instead of crashing.

…sue libfuse#836)

The hello_ll example crashed when getxattr/setxattr/removexattr were
called for unexpected inodes, because assert() would abort the process.
The kernel can invoke xattr operations for any inode, so replace asserts
with proper fuse_reply_err() calls that gracefully return ENODATA or
ENOTSUP instead of crashing.
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

…use#836)

Add test_hello_ll_root_xattr that mounts hello_ll and performs xattr
operations on the root directory (inode 1). Without the fix, the
assert(ino == 2) in the xattr handlers causes SIGABRT when getxattr
is called on the root directory. With the fix, proper error codes
are returned instead.
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