All of lore.kernel.org
 help / color / mirror / Atom feed
* Seccomp implications for glibc wrapper function changes
@ 2017-11-07 20:35 Michael Kerrisk (man-pages)
       [not found] ` <CAKgNAkixA6T7J_1Gs=5+riq6i=dr9XP4ZCGu67YVcuDNg3cT4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-11-07 20:35 UTC (permalink / raw)
  To: libc-alpha-9JcytcrH/bA+uJoB2kUjGw
  Cc: Linux API, Adhemerval Zanella, Michael Kerrisk

Hello,

I was recently testing some code I'd written a while back that makes
use of seccomp filters to control which system calls a process can
make, and I got a surpise when someone showed the code no longer
worked in on a system that had glibc 2.26.

The behavior change resulted from Adhemerval's glibc commit

     commit b41152d716ee9c5ba34495a54e64ea2b732139b5
     Author: Adhemerval Zanella <adhemerval.zanella-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
     Date:   Fri Nov 11 15:00:03 2016 -0200

        Consolidate Linux open implementation
            [...]
            3. Use __NR_openat as default syscall for open{64}.

The commit in question changed the glibc open() wrapper to swtcch from
use the kernel's open() system call to using the kernel's openat()
system call.

This change broke my code that was doing seccomp filtering for the
open() system call number (__NR_open). The breakage in question is not
serious, since this was really just demonstration code. However, I
want to raise awareness that these sorts of changes have the potential
to possibly cause breakages for some code using seccomp, and note that
I think such changes should not be made lightly or gratuitously. (In
the above commit, it's not clear why the switch was made to using
openat(): there's no mention of the reasoning in the commit message,
nor is there anything that is obvious from reading through the code
change itself.)

Best regards,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-11-14  7:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 20:35 Seccomp implications for glibc wrapper function changes Michael Kerrisk (man-pages)
     [not found] ` <CAKgNAkixA6T7J_1Gs=5+riq6i=dr9XP4ZCGu67YVcuDNg3cT4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-07 21:14   ` Adhemerval Zanella
     [not found]     ` <be4cc7fc-90c2-4370-2eab-8948d0ba75be-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-11-07 21:47       ` Michael Kerrisk (man-pages)
     [not found]         ` <CAKgNAkiRFsUigsV1OCrrjUzq8MO3wwtsT2SGuOJth56OcqCTcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-08  1:18           ` Adhemerval Zanella
     [not found]             ` <2884aeec-a7ba-937a-4f77-7225dd4ef00c-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-11-09  7:15               ` Michael Kerrisk (man-pages)
2017-11-08  6:24   ` Florian Weimer
2017-11-09  7:17     ` Michael Kerrisk (man-pages)
     [not found]       ` <CAKgNAkhLsBNVO9axSxwH8VNxBW1QPWjaEOS_ubu-nUZ7_gsn7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-09 11:58         ` Michael Kerrisk (man-pages)
     [not found]           ` <CAKgNAkjAbRN7gVuErpmBZ2YtkYfRSAdnWVdRR1B34BvszRZ0-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-09 12:02             ` Florian Weimer
     [not found]               ` <c2965313-404b-71fb-0686-bd13fde2b975-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-09 12:14                 ` Adhemerval Zanella
2017-11-09 17:27                   ` Michael Kerrisk (man-pages)
2017-11-09 13:37                 ` Michael Kerrisk (man-pages)
     [not found]                   ` <CAKgNAki9m460sOw8KP9unnBU_ANctXj4H=gUEiRgRhUHFGjDbQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-13 22:44                     ` Kees Cook
     [not found]                       ` <CAGXu5jJwgavx5jNpMGdR5D4rAv4GxtrERgGgi-FQDaROOTocLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-14  7:00                         ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.