Page MenuHomeFreeBSD

fusefs: validate servers' error values
ClosedPublic

Authored by asomers on Apr 15 2022, 7:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 1:24 PM
Unknown Object (File)
Mar 1 2024, 12:07 PM
Unknown Object (File)
Feb 29 2024, 11:57 AM
Unknown Object (File)
Dec 23 2023, 12:30 AM
Unknown Object (File)
Nov 12 2023, 5:54 AM
Unknown Object (File)
Aug 1 2023, 10:41 PM
Unknown Object (File)
Jul 13 2023, 10:17 AM
Unknown Object (File)
Jun 5 2023, 12:46 AM
Subscribers

Details

Summary

Formerly fusefs would pass up the stack any error value returned by the
fuse server. However, some values aren't valid for userland, but have
special meanings within the kernel. One of these, EJUSTRETURN, could
cause a kernel page fault if the server returned it in response to
FUSE_LOOKUP. Fix by validating all errors returned by the server.

Also, fix a data lifetime bug in the FUSE_DESTROY test.

PR: 263220
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 3 weeks
Sponsored by: Axcient

Test Plan

Test case added

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/fuse/fuse_device.c
524–525

is this the same in each branch?

sys/fs/fuse/fuse_device.c
524–525

Almost. The memcpy part is the same, but the tk_aw_handler part isn't. And memcpy needs to happen first. Annoyingly repetitive I know, but I couldn't find a way to remove the repetition that didn't actually increase total lines.

This revision is now accepted and ready to land.Apr 15 2022, 7:49 PM
This revision was automatically updated to reflect the committed changes.