protonscr

Please make libcef compatible with GLIBC_2.13.

steamclosed Feature Requestreviewed
ValveSoftware/steam-for-linux#1806 · opened 2013-02-15 by ghost · updated 2019-07-18 · 6 comments · github
?ghost 2013-02-15 github

Debian testing (and even Debian sid) ship with eglibc 2.13. However, libcef.so requires GLIBC_2.15, only for __fdelt_chk:

$ readelf -s libcef.so | grep -E "@GLIBC_2\.1[4567]"
1037: 00000000     0 FUNC    GLOBAL DEFAULT  UND __fdelt_chk@GLIBC_2.15 (49)
2733: 00000000     0 FUNC    GLOBAL DEFAULT  UND __fdelt_chk@@GLIBC_2.15

Is it possible to remove this function from the dynamic imports, so that libcef.so (and thus steamui.so and steam) may load under Debian testing? I'm not really keen on getting the libc from Debian experimental, and I can't figure out how to shim this function.

Ggdrewb-valve maintainer 2013-02-15 github

CEF is not Valve software so I can't really answer whether this would be easy or not, but we can check. I would not expect a fix in the near term.

?ghost 2013-02-15 github

It might not be easy, due to the clunky mess that is FSF/GNU source code. To explain where this symbol comes from:


In order to facilitate I/O multiplexing, POSIX has the select function. You bundle a few file descriptors in an fd_set structure, call select on it, and when it returns, you'll know which file descriptor from the set is readable and/or writable.

To manipulate the fd_set structure, there are a few of macros available in <sys/select.h>. From misc/sys/select.h:

#define FD_SET(fd, fdsetp)  __FD_SET (fd, fdsetp)
#define FD_CLR(fd, fdsetp)  __FD_CLR (fd, fdsetp)
#define FD_ISSET(fd, fdsetp)    __FD_ISSET (fd, fdsetp)

These macros are defined in bits/select.h:

#define __FD_SET(d, s) \
  ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d)))
#define __FD_CLR(d, s) \
  ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d)))
#define __FD_ISSET(d, s) \
  ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0)    

Unless you've disabled fortification, __FD_ELT is defined in misc/bits/select2.h:

#undef __FD_ELT
#define __FD_ELT(d) \
  __extension__                                 \
  ({ long int __d = (d);                            \
     (__builtin_constant_p (__d)                        \
      ? (0 <= __d && __d < __FD_SETSIZE                     \
     ? (__d / __NFDBITS)                            \
     : __fdelt_warn (__d))                          \
      : __fdelt_chk (__d)); })

In case compile-time checking fails, a run-time check is used. debug/fdelt_chk.c:

long int
__fdelt_chk (long int d)
{
  if (d < 0 || d >= FD_SETSIZE)
    __chk_fail ();

  return d / __NFDBITS;
}

This redefinition is activated in <misc/sys/select.h> when fortification is enabled:

#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__
# include <bits/select2.h>
#endif

One approach be to disable fortification when compiling libcef. Not the best idea, but you'll probably lose all imports of the *_chk functions. These functions will make the program crash and burn when a security condition is violated. When disabled, the behaviour is undefined.

Another approach might be to find where the FD_* macros are used (I couldn't find it, perhaps it's in a library libcef uses), and replace them with less portable code. Or drop fdelt_chk.c in that part of the source tree.

Ggdrewb-valve maintainer 2013-02-15 github

Thanks for the info. I would definitely not expect a fix soon. :-)

?ghost 2013-02-15 github

That's completely understandable, since you're not targeting Debian. Close as wontfix then?

Ggdrewb-valve maintainer 2013-02-15 github

We can hold on to it for now, it's a good reminder of a possible item.

Kkisak-valve maintainer 2017-04-06 github

Closing as Debian Sid has moved forward since this issue report.

Nothing extracted yet.