[File] The seccomp filter on any ppc architecture may fail

Dr. Werner Fink werner at suse.de
Mon Mar 24 07:54:47 UTC 2025


On 2025/03/20 10:58:17 -0400, Christos Zoulas wrote:
> Committed, thanks! Wow, what a mess.
> 
> christos
> 
> > On Mar 20, 2025, at 9:38 AM, Dr. Werner Fink <werner at suse.de> wrote:
> > 
> > Hi,
> > 
> > I had a bug report that on physical terminals like /dev/console the
> > seccomp filter cause a SIGSYS due to not allowd TCGETS ioctl.  This
> > ioctl is performed by glibc its self by its tcgetattr(3) call.
> > 
> > The problem is that the TCGETS get by the includes
> > 
> > #include <termios.h>
> > #include <sys/ioctl.h>
> > 
> > are wrong on ppc based architectures and will not be fixed by the glibc
> > people (see https://sourceware.org/bugzilla/show_bug.cgi?id=32806)
> > 
> > A workaround is here for
> > 
> > #ifdef __powerpc64__
> > # include <asm/termbits.h>
> > #else
> > # include <termios.h>
> > #endif
> > #include <sys/ioctl.h>
> > 
> > where <asm/termbits.h> if includes before <sys/ioctl.h>
> > 
> > In the attachment is my patch for this
> > 

Just to be noted in the latest manual page section 2 for ioctl 
for Linux man-pages 2024-06-14 (unreleased) I see ...

 NAME
       ioctl_tty - ioctls for terminals and serial lines

 LIBRARY
       Standard C library (libc, -lc)

 SYNOPSIS
       #include <asm/termbits.h>  /* Definition of constants */
       #include <sys/ioctl.h>

       int ioctl(int fd, int op, ...);

means the ifdef __powerpc64__ seems to work even for other
architectures.  Only the <termios.h> gives the wrong ioctl for
terminal attributes on ppc as the struct termios is not that
what the kernel uses.

Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 894 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20250324/c1efc23c/attachment.asc>


More information about the File mailing list