public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: Siddhesh Poyarekar <siddhesh@gotplt.org>,
	 GCC Patches <gcc-patches@gcc.gnu.org>,
	Carlos O'Donell <carlos@redhat.com>,
	 richard.sandiford@arm.com
Subject: Re: [RFC] GCC Security policy
Date: Wed, 16 Aug 2023 03:37:31 +0300 (MSK)	[thread overview]
Message-ID: <742a157b-2301-6cee-b333-791a1e37d6aa@ispras.ru> (raw)
In-Reply-To: <CAGWvnyn9byKhe8oYKuOSqJ=89JVyYHiBFzt8s00ziiUnCtJpsw@mail.gmail.com>


On Tue, 15 Aug 2023, David Edelsohn wrote:

> > Making users responsible for verifying that sources are "safe" is not okay
> > (we cannot teach them how to do that since there's no general method).
> > Making users responsible for sandboxing the compiler is fine (there's
> > a range of sandboxing solutions, from which they can choose according
> > to their requirements and threat model). Sorry about the ambiguity.
> >
> 
> Alex.
> 
> The compiler should faithfully implement the algorithms described by the
> programmer.  The compiler is responsible if it generates incorrect code for
> a well-defined, language-conforming program.  The compiler cannot be
> responsible for security issues inherent in the user code, whether that
> causes the compiler to function in a manner that deteriorates adversely
> affects the system or generates code that behaves in a manner that
> adversely affects the system.
> 
> If "safe" is the wrong word. What word would you suggest?

I think "safe" is the right word here. We also used "trusted" in a similar
sense. I believe we were on the same page about that.

> > For both 1) and 2), GCC is not engineered to respect such properties
> > during optimization and code generation, so it's not appropriate for such
> > tasks (a possible solution is to isolate such sensitive functions to
> > separate files, compile to assembly, inspect the assembly to check that it
> > still has the required properties, and use the inspected asm in subsequent
> > builds instead of the original high-level source).
> >
> 
> At some point the system tools need to respect the programmer or operator.
> There is a difference between writing "Hello, World" and writing
> performance critical or safety critical code.  That is the responsibility
> of the programmer and the development team to choose the right software
> engineers and right tools.  And to have the development environment and
> checks in place to ensure that the results are meeting the requirements.
> 
> It is not the role of GCC or its security policy to tell people how to do
> their job or hobby.  This isn't a safety tag required to be attached to a
> new mattress.

Yes (though I'm afraid the analogy with the mattress is a bit lost on me).
Those examples were meant to illustrate the point I tried to make earlier,
not as additions proposed for the Security Policy. Specific examples
where we can tell people in advance that compiler output needs to be
verified, because the compiler is not engineered to preserve those
security-relevant properties from the source code (and we would not
accept such accidents as security bugs).

Granted, it is a bit of a stretch since the notion of timing-safety is
not really well-defined for C source code, but I didn't come up with
better examples.

Alexander

  reply	other threads:[~2023-08-16  0:37 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 17:29 David Edelsohn
2023-08-08  8:16 ` Richard Biener
2023-08-08 12:33   ` Siddhesh Poyarekar
2023-08-08 12:52     ` Richard Biener
2023-08-08 13:01       ` Jakub Jelinek
2023-08-08 13:21         ` Richard Biener
2023-08-08 13:24         ` Michael Matz
2023-08-08 13:33         ` Paul Koning
2023-08-08 15:48           ` David Malcolm
2023-08-08 15:55             ` Siddhesh Poyarekar
2023-08-08 16:35               ` Paul Koning
2023-08-08 20:02             ` Joseph Myers
2023-08-08 13:34         ` Ian Lance Taylor
2023-08-08 14:04           ` Richard Biener
2023-08-08 14:06             ` Siddhesh Poyarekar
2023-08-08 14:14               ` David Edelsohn
2023-08-08 14:30                 ` Siddhesh Poyarekar
2023-08-08 14:37                   ` Jakub Jelinek
2023-08-08 14:40                     ` Siddhesh Poyarekar
2023-08-08 16:22                       ` Richard Earnshaw (lists)
2023-08-08 17:35                     ` Ian Lance Taylor
2023-08-08 17:46                       ` David Edelsohn
2023-08-08 19:39                         ` Carlos O'Donell
2023-08-09 13:25                           ` Richard Earnshaw (lists)
2023-08-09 17:32                   ` Siddhesh Poyarekar
2023-08-09 18:17                     ` David Edelsohn
2023-08-09 20:12                       ` Siddhesh Poyarekar
2023-08-10 18:28                     ` Richard Sandiford
2023-08-10 18:50                       ` Siddhesh Poyarekar
2023-08-11 14:36                         ` Siddhesh Poyarekar
2023-08-11 15:09                           ` Paul Koning
2023-08-11 15:20                             ` Siddhesh Poyarekar
2023-08-10 19:27                       ` Richard Biener
2023-08-11 15:12                     ` David Edelsohn
2023-08-11 15:22                       ` Siddhesh Poyarekar
2024-02-09 15:38       ` Martin Jambor
2024-02-09 15:55         ` Siddhesh Poyarekar
2024-02-09 17:14           ` Joseph Myers
2024-02-09 17:39             ` Siddhesh Poyarekar
2024-02-09 20:06               ` Joseph Myers
2024-02-12 13:32                 ` Siddhesh Poyarekar
2024-02-12 13:16           ` Martin Jambor
2024-02-12 13:35             ` Siddhesh Poyarekar
2024-02-12 15:00               ` Richard Biener
2024-02-13 12:34                 ` Siddhesh Poyarekar
2023-08-14 13:26 ` Siddhesh Poyarekar
2023-08-14 18:51   ` Richard Sandiford
2023-08-14 19:31     ` Siddhesh Poyarekar
2023-08-14 21:16       ` Alexander Monakov
2023-08-14 21:50         ` Siddhesh Poyarekar
2023-08-15  5:59           ` Alexander Monakov
2023-08-15 10:33             ` Siddhesh Poyarekar
2023-08-15 14:07               ` Alexander Monakov
2023-08-15 14:54                 ` Paul Koning
2023-08-15 19:13                 ` Siddhesh Poyarekar
2023-08-15 23:07                   ` Alexander Monakov
2023-08-15 23:45                     ` David Edelsohn
2023-08-16  0:37                       ` Alexander Monakov [this message]
2023-08-16  0:50                         ` Paul Koning
2023-08-16  7:53                           ` Alexander Monakov
2023-08-16 13:06                             ` Paul Koning
2023-08-16  9:05                     ` Toon Moene
2023-08-16 12:19                     ` Siddhesh Poyarekar
2023-08-16 15:06                       ` Alexander Monakov
2023-08-16 15:18                         ` Siddhesh Poyarekar
2023-08-16 16:02                           ` Alexander Monakov
2023-08-15 23:45   ` David Malcolm
2023-08-16  8:25     ` Alexander Monakov
2023-08-16 11:39       ` Siddhesh Poyarekar
2023-08-16 11:50         ` Alexander Monakov
2023-09-06 11:23 ` Siddhesh Poyarekar
2023-09-20  7:36 ` Arnaud Charlet

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=742a157b-2301-6cee-b333-791a1e37d6aa@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=carlos@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    --cc=siddhesh@gotplt.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).