Bug 15367 - socket_wrapper wraps fcntl64 into fcntl
Summary: socket_wrapper wraps fcntl64 into fcntl
Status: NEW
Alias: None
Product: cwrap
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: x86 All
: P5 normal
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-04 05:41 UTC by Andrew Bartlett
Modified: 2023-05-08 02:10 UTC (History)
1 user (show)

See Also:


Attachments
Samba test binary that shows the issue on 32 bit (2.14 KB, text/plain)
2023-05-04 05:41 UTC, Andrew Bartlett
no flags Details
Samba build system patch for demonstration binary (662 bytes, text/plain)
2023-05-04 05:48 UTC, Andrew Bartlett
no flags Details
Partial patch (needs cmake) (2.78 KB, patch)
2023-05-04 05:56 UTC, Andrew Bartlett
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Bartlett 2023-05-04 05:41:40 UTC
Created attachment 17877 [details]
Samba test binary that shows the issue on 32 bit

socket_wrapper wraps fcntl64 (renamed in socket_wrapper.c from fcntl.h) into fcntl, causing a thunk of the struct flock64 into struct flock64 (it is assumed to be struct flock, eg without _FILE_OFFSET_BITS=64). 

It is demonstrated with the attached samba test binary and: 

LD_PRELOAD=bin/shared/libsocket-wrapper.so ./bin/test_fcntl foo
Comment 1 Andrew Bartlett 2023-05-04 05:44:37 UTC
This is only seen on Debian 11, not Ubuntu 18.04.

On Ubuntu 18.04 fcntl is not renamed and the wrapping is correctly handled.
Comment 2 Andrew Bartlett 2023-05-04 05:48:11 UTC
Created attachment 17878 [details]
Samba build system patch for demonstration binary
Comment 3 Andrew Bartlett 2023-05-04 05:56:25 UTC
Created attachment 17879 [details]
Partial patch (needs cmake)

This is relative to samba currently.