Page MenuHomeFreeBSD

libc: properly reference setgroups@FBSD_1.0 in initgroups@FBSD_1.0
ClosedPublic

Authored by kib on Sun, Sep 21, 11:29 PM.
Tags
None
Referenced Files
F132183934: D52672.id162552.diff
Tue, Oct 14, 1:49 PM
Unknown Object (File)
Sat, Oct 11, 6:58 AM
Unknown Object (File)
Sat, Oct 11, 6:58 AM
Unknown Object (File)
Sat, Oct 11, 6:57 AM
Unknown Object (File)
Fri, Oct 10, 11:41 PM
Unknown Object (File)
Fri, Oct 10, 7:39 PM
Unknown Object (File)
Wed, Oct 8, 1:10 AM
Unknown Object (File)
Fri, Oct 3, 10:42 AM
Subscribers

Diff Detail

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

Event Timeline

kib requested review of this revision.Sun, Sep 21, 11:29 PM

It does make me wonder about all of the freebsd11_* bits in the same file that we use for pre-ino64 stuff, but my main concern is just fixing initgroups(3) for stable/15... we can always haggle on any other details later, if we need to.

This revision is now accepted and ready to land.Mon, Sep 22, 3:52 AM

It does make me wonder about all of the freebsd11_* bits in the same file that we use for pre-ino64 stuff

freebsd11_ ino are different: they call ino64 versions and then translate results into the structures with pre-ino64 layout. In other words, they never called compat syscalls directly or indirectly.

Thanks for tackling this quickly.

From D52641:

Exporting freebsd14_setgroups@FBSDprivate_1.0 in libsys works, but only if I also hack up libsys/Makefile.sys to filter freebsd14_setgroups* out of MIASM to avoid creating conflicting weak refs in the libc build.

I've tried a lot of combinations since then, and frankly I still don't understand exactly why sometimes things work and sometimes not.

It seems that just exporting freebsd14_setgroups@FBSDprivate_1.0 from libsys is not enough because for some reason the freebsd14_setgroups symbol from libc somehow differs. Believe it or not, exporting freebsd14_setgroups in FBSDprivate_1.0 in lib/libc/sys/Symbol.map actually makes it work! This seems non-sensical, as the export from libsys is supposed to be merged into the final version file for libc.

I might have found a better way than what is done here.

In D52672#1203041, @kib wrote:

It does make me wonder about all of the freebsd11_* bits in the same file that we use for pre-ino64 stuff

freebsd11_ ino are different: they call ino64 versions and then translate results into the structures with pre-ino64 layout. In other words, they never called compat syscalls directly or indirectly.

No, some are similar. We have a bunch of direct calls to freebsd11_*() system calls, see, e.g, lib/libc/gen/fts-compat.c with calls to freebsd11_lstat, freebsd11_fstat and freebsd11_statfs. These are most probably all broken for the same reason as my first version of calling freebsd14_setgroups() from libc was.

Please see D52685 as a porposal to simplifying the change here and fixing other compatibility system calls.