Bug 493507 - direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE_MAY_BLOCK
Summary: direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.24 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-22 22:14 UTC by Mark Wielaard
Modified: 2024-10-05 12:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Implement /proc/self/exe readlink[at] fallback in POST handler (16.83 KB, text/plain)
2024-09-22 22:14 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2024-09-22 22:14:23 UTC
Created attachment 173980 [details]
Implement /proc/self/exe readlink[at] fallback in POST handler

The generic and linux readlink[at] syscall PRE handler calls readlink[at] directly. This is incompatible with the FUSE_COMPATIBLE_MAY_BLOCK flag. Resolve this by adding a POST handler and only do a direct readlink[at] call (in the POST handler) if we need the /proc/self/exe fallback.
Comment 1 Mark Wielaard 2024-10-05 12:53:56 UTC
commit 0690dc39644d15fc89813419ffcdf9754b098260
Author: Mark Wielaard <mark@klomp.org>
Date:   Sun Sep 22 23:24:34 2024 +0200

    Implement /proc/self/exe readlink[at] fallback in POST handler
    
    Calling the readlink[at] syscall directly from the PRE handler defeats
    the FUSE_COMPATIBLE_MAY_BLOCK (SfMayBlock) flag. Add a POST handler
    that only explicitly calls the readlink[at] handler for the
    /proc/self/exe fallback (this should be fine unless /proc is also
    implemented as fuse in this process).
    
    Adjust readlink[at] GENX_ and LINX_ syswrap macros to GENXY and LINXY.
    
    https://bugs.kde.org/show_bug.cgi?id=493507