Bug 2036722

Summary: nosync.so is linked against GLIBC_2.34 symbols, breaking mock for older chroots
Product: [Fedora] Fedora Reporter: Pavel Raiskup <praiskup>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 35CC: aoliva, arjun.is, code, codonell, davide, dj, dominik, extras-qa, fweimer, hobbes1069, java-sig-commits, kevin, kostadin.bukov, kwizart, law, markus.falb, mcermak, mfabian, mizdebsk, pfrankli, rjones, rth, sgraf, sipoyare, tom, yaneti
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2019329 Environment:
Last Closed: 2022-01-18 14:36:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2019329    
Bug Blocks:    

Description Pavel Raiskup 2022-01-03 17:19:55 UTC
+++ This bug was initially created as a clone of Bug #2019329 +++

> --- Additional comment from Pavel Raiskup on 2021-12-15 11:19:54 CET ---
> 
> This patch could help to link against 2.2.5 symbols:
> https://copr-dist-git.fedorainfracloud.org/cgit/praiskup/nosync-libc-2.2.5/nosync.git/commit/?id=0bb4978918b7de10e2d8ea7c49ccc03bf94b3856
> 
> Though this fails in i386, and this library needs to be built multilib:
> https://copr.fedorainfracloud.org/coprs/praiskup/nosync-libc-2.2.5/build/3048930/
> 
> ....
> cc -shared -fPIC -ldl -lpthread -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -o nosync.so fsync.o open.o
> /usr/bin/ld: nosync.so: no symbol version section for versioned symbol `dlsym.5'
> collect2: error: ld returned 1 exit status
> 
> Even if the glibc versioning on i386 was fixed (or whatever is causing
> this), this doesn't seem to be a long-term solution?
> 
> It would be nice if nosync was a glibc subpackage with statically
> linked dlsym() and pthread_testcancel().  But this is probably unrealistic.

I'm just curious whether glibc folks could help us to answer some of the
questions.

- Is there a way to link a binary against 2.2.5 symbols on i386?
- Could nosync.so be part of glibc (sub-package), with statically linked
  symbols?
- Any other idea how to way-around this?

For more info about the nosync.so problems please see the original bug.

Comment 1 Florian Weimer 2022-01-04 14:33:36 UTC
You should probably build a restricted version of nosync.so that only intercepts fsync and sync. This way, you don't need to use dlsym to do any forwarding of calls.

Long term, this really, really needs kernel support. I believe overlayfs2 has recently received nosync support for the upper layer.

Comment 2 Florian Weimer 2022-01-18 14:36:04 UTC
See comment 1. I checked that RPM installation does not use O_SYNC/O_DSYNC, so just that stubbing out fsync, sync, and sync_file_range should be sufficient.