Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
adds missing jail and MAC checks.
Details
- Reviewers
kib - Group Reviewers
Linux Emulation - Commits
- rS281551: Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
This is most likely a good change.
sys/compat/linprocfs/linprocfs.c | ||
---|---|---|
335 ↗ | (On Diff #4562) | Do not initialize in definition. It is probably safer to initialize the buf to NULL (not required, but it made me wonder for a moment). |
342 ↗ | (On Diff #4562) | I see that this is not changed, but why is error from namei() ignored ? |
It seems reasonable to change the kern_getfsstat() to return the count explicitely, instead of relying on td_retval. I think it was only used by compat32 so far, but new use is ugly without the proper handling of count.
I think the error is ignored to account for possibility that the path doesn't exist. I'd prefer not to touch it for now, this code is a little scary.
As for returning the count from kern_getfsstat() - good point, but I'd rather leave this for later.
I do not like td_retval thing, it is too hackish. IMO this is exactly the right moment to fix it.
I agree that handling namei error (or commenting why error could be ignored) is for the other moment.
Hm, okay. How to return the count, then? Reuse the 'count' argument, or add a new one? Is there a convention that says which argument should it be? The last?
Up to you and a common sense. I would add the last argument like int *count (exact type might need some correction).
sys/kern/vfs_syscalls.c | ||
---|---|---|
635 ↗ | (On Diff #4815) | There too ? |