All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	libc-alpha@sourceware.org, Linux API <linux-api@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>
Subject: Re: Seccomp implications for glibc wrapper function changes
Date: Thu, 9 Nov 2017 18:27:33 +0100	[thread overview]
Message-ID: <CAKgNAkgNdv7xy00k-hk1kbodJ9vbO_YFTSQj2jgfeJYkRsKf2A@mail.gmail.com> (raw)
In-Reply-To: <690547e9-b67f-d106-0782-ed6f3ca2eb18@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]

On 9 November 2017 at 13:14, Adhemerval Zanella <
adhemerval.zanella@linaro.org> wrote:
>
>
> On 09/11/2017 10:02, Florian Weimer wrote:
>> On 11/09/2017 12:58 PM, Michael Kerrisk (man-pages) wrote:
>>> [CC += Kees, in case he has some comments]
>>>
>>> On 9 November 2017 at 08:17, Michael Kerrisk (man-pages)
>>> <mtk.manpages@gmail.com> wrote:
>>>> Hi Florian,
>>>>
>>>> On 8 November 2017 at 07:24, Florian Weimer <fweimer@redhat.com> wrote:
>>>>> On 11/07/2017 09:35 PM, Michael Kerrisk (man-pages) wrote:
>>>>>>
>>>>>> 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.
>>>>>
>>>>>
>>>>> I have the opposite view: We should make such changes as often as
possible,
>>>>> to remind people that seccomp filters (and certain SELinux and
AppArmor
>>>>> policies) are incompatible with the GNU/Linux model, where everything
is
>>>>> developed separately and not maintained within a single source tree
(unlike
>>>>> say OpenBSD). This means that you really can't deviate from the
upstream
>>>>> Linux userspace ABI (in the broadest possible sense) and still expect
things
>>>>> to work.
>>>>>
>>>>> I know that people like to slap seccomp filters on everything today,
but
>>>>> without careful examination, that is likely to introduce bugs
(particularly
>>>>> on rarely used code paths). It can also cause the process to switch to
>>>>> legacy interfaces with known issues (e.g., reading from /dev/urandom
instead
>>>>> of getrandom, without waiting for the kernel to signal initialization
of the
>>>>> pool).
>>>>
>>>> Thanks. The above is a good summary of the counterpoints to my initial
argument.
>>>
>>> Florian, taking your and Adhemerval's useful comments into account, I
>>> added the following text to the seccomp(2) manual page:
>>>
>>> [[
>>> Caveats
>>> There are various subtleties to consider when applying seccomp
>>> filters to a program, including the following:
>>>
>>> * Some traditional system calls have user-space implementations
>>> in the vdso(7) on many architectures. Notable examples include
>>> clock_gettime(2), gettimeofday(2), and time(2). On such archi‐
>>> tectures, seccomp filtering for these system calls will have no
>>> effect.
>>
>> I think the situation is more complicated for many of those because they
can still perform system calls on their fallback paths. So it's one more
case where seccomp can give you unpredictable failures.
>>
>> Rest looks good to me. Thanks for the writeup.
>>
>> Florian
>
> Looks good to me as well.

Thanks for the review, Adhemerval!

Cheers,

Michael

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

[-- Attachment #2: Type: text/html, Size: 4307 bytes --]

  reply	other threads:[~2017-11-09 17:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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) [this message]
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)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKgNAkgNdv7xy00k-hk1kbodJ9vbO_YFTSQj2jgfeJYkRsKf2A@mail.gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=keescook@chromium.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.