From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Ian Lance Taylor <iant@google.com>
Cc: Paul Koning <paulkoning@comcast.net>,
Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
Nick Clifton <nickc@redhat.com>,
Binutils <binutils@sourceware.org>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: RFC: Adding a SECURITY.md document to the Binutils
Date: Fri, 14 Apr 2023 14:27:00 -0400 [thread overview]
Message-ID: <20dbbe16-c7e5-412e-0506-2118dfef5fc2@gotplt.org> (raw)
In-Reply-To: <CAKOQZ8w2BY7imHqH9fD=6CgOMw5qgLAwRQ0Ea7hzasUrPRqK3g@mail.gmail.com>
On 2023-04-14 13:37, Ian Lance Taylor wrote:
> On Thu, Apr 13, 2023 at 10:01 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>>
>> On 2023-04-13 12:49, Paul Koning wrote:
>>> If someone sends me an executable file, and I execute it and suffer a virus, shame on me. If someone sends me a C source file and I compile and link that BUT DO NOT EXECUTE the resulting executable, and I suffer a virus, shame on the tool.
>>
>> If someone sends me a C source file and I compile and link it without
>> inspecting it first, then definitely shame on me again. Compilers and
>> linkers assume *trusted* input.
>
> I profoundly disagree with this.
I should reiterate that this is not about robustness, it is about
treatment of bugs as security issues, i.e. by assigning CVEs and sending
out advisories to the larger user community. I am not arguing against
fixing bugs at all.
> Compilers and linkers must behave in a reasonable manner when given
> untrusted input. Behaving reasonably can of course include failing
> with an error message like "program too large", but they must not dump
> core and they must not use up all available memory. They very much
> must not have a buffer overflow during compilation that causes them to
> execute arbitrary code. Users should not be expected to run compilers
A compiler crash, core dump, etc. is definitely a serious bug and we
consider them as P1/P2 in almost all cases. However to be considered a
security issue, the input has to be crafted and that's where the user
comes in; their responsibility is to ensure that they don't build
untrusted code (e.g. when they're trying to study malware or virus
sources or binaries) outside of sandboxes.
The expectation is *not* that they always run compilers in a sandbox, it
is that they're aware of the code they're trying to compile and IMO it
is not an unreasonable expectation. The odds of even minimally trusted
code (like an upstream project) resulting in, e.g. overwriting or
corrupting some persistent state (like some file on disk) or sending out
private information due to a buffer overflow in gcc, ld, or even objdump
is near-zero. The code would have to be specially *crafted* (or the
operator being remarkably unlucky) to achieve that.
If as a project we decide to treat untrusted input as a valid use case,
it is going to shift the goalposts for binutils (and gcc, if we take the
same stand there). I suppose golang does try to adhere to these higher
standards somewhat but I am not well versed with their formal position
on this. I've seen them consider bugs due to untrusted regex inputs as
security issues whereas even glibc currently doesn't, except for some
very specific conditions.
The llvm project doesn't consider anything[1] a security issue at the
moment. I was told off-hand by a rust maintainer that the rust
community also pretty much aligns with the llvm position, but I don't
have a handy reference for it.
If binutils, gcc, etc. aspire to the levels of support that golang
provides, we need to do what the llvm community is currently doing, i.e.
form a security group and incrementally identify parts that we want to
identify as security sensitive and provide stronger security guarantees
for them. My previous suggestion to do that was discouraged[2], so if
that has changed today then we could move in that direction.
> and linkers in a security sandbox (though it would be acceptable for a
> compiler to set up its own security sandbox if that seems useful).
I suggested an --isolate flag for the analysis tools (objdump, etc.) to
do exactly this elsewhere in this thread.
Thanks,
Sid
[1] https://llvm.org/docs/Security.html#what-is-considered-a-security-issue
[2] https://inbox.sourceware.org/binutils/YBD72RqjVomppMYS@vapier/
next prev parent reply other threads:[~2023-04-14 18:27 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 8:42 Nick Clifton via Gdb
2023-04-07 10:36 ` Eli Zaretskii via Gdb
2023-04-11 13:29 ` Nick Clifton via Gdb
2023-04-11 14:23 ` Simon Marchi via Gdb
2023-04-11 15:00 ` Eli Zaretskii via Gdb
2023-04-11 16:22 ` Nick Clifton via Gdb
2023-04-11 16:32 ` Matt Rice via Gdb
2023-04-11 18:18 ` J.W. Jagersma via Gdb
2023-04-12 8:43 ` Nick Clifton via Gdb
2023-04-08 6:30 ` Jan Beulich via Gdb
2023-04-10 18:30 ` John Baldwin
2023-04-20 15:56 ` Nick Clifton via Gdb
2023-04-11 19:45 ` Ian Lance Taylor via Gdb
2023-04-12 16:02 ` Richard Earnshaw via Gdb
2023-04-12 16:26 ` Siddhesh Poyarekar
2023-04-12 16:52 ` Richard Earnshaw via Gdb
2023-04-12 16:58 ` Paul Koning via Gdb
2023-04-12 17:10 ` Siddhesh Poyarekar
2023-04-13 3:51 ` Alan Modra via Gdb
2023-04-13 4:25 ` Siddhesh Poyarekar
2023-04-13 5:16 ` Alan Modra via Gdb
2023-04-13 12:00 ` Siddhesh Poyarekar
2023-04-13 10:25 ` Richard Earnshaw via Gdb
2023-04-13 11:53 ` Siddhesh Poyarekar
2023-04-13 12:37 ` Richard Earnshaw via Gdb
2023-04-13 12:54 ` Siddhesh Poyarekar
2023-04-13 13:11 ` Richard Earnshaw via Gdb
2023-04-13 13:35 ` Siddhesh Poyarekar
2023-04-13 13:40 ` Richard Earnshaw via Gdb
2023-04-13 13:56 ` Siddhesh Poyarekar
2023-04-13 14:50 ` Richard Earnshaw via Gdb
2023-04-13 15:02 ` Siddhesh Poyarekar
2023-04-13 15:05 ` Richard Earnshaw via Gdb
2023-04-13 16:42 ` Siddhesh Poyarekar
2023-04-14 9:52 ` Richard Earnshaw via Gdb
2023-04-14 12:43 ` Siddhesh Poyarekar
2023-04-14 12:49 ` Richard Earnshaw via Gdb
2023-04-14 13:13 ` Siddhesh Poyarekar
2023-04-13 15:08 ` Paul Koning via Gdb
2023-04-13 16:02 ` Siddhesh Poyarekar
2023-04-13 16:49 ` Paul Koning via Gdb
2023-04-13 17:00 ` Siddhesh Poyarekar
2023-04-13 17:05 ` Paul Koning via Gdb
2023-04-13 17:29 ` Siddhesh Poyarekar
2023-04-13 17:37 ` Paul Koning via Gdb
2023-04-13 18:16 ` Siddhesh Poyarekar
2023-04-14 17:37 ` Ian Lance Taylor via Gdb
2023-04-14 18:27 ` Siddhesh Poyarekar [this message]
2023-04-14 20:46 ` Ian Lance Taylor via Gdb
2023-04-14 21:24 ` Siddhesh Poyarekar
2023-04-17 15:31 ` Michael Matz via Gdb
2023-04-17 19:55 ` Ian Lance Taylor via Gdb
2023-04-14 19:45 ` DJ Delorie via Gdb
2023-04-14 20:49 ` Ian Lance Taylor via Gdb
2023-04-15 6:41 ` Xi Ruoyao via Gdb
2023-04-13 16:06 ` Richard Earnshaw via Gdb
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=20dbbe16-c7e5-412e-0506-2118dfef5fc2@gotplt.org \
--to=siddhesh@gotplt.org \
--cc=Richard.Earnshaw@foss.arm.com \
--cc=binutils@sourceware.org \
--cc=gdb@sourceware.org \
--cc=iant@google.com \
--cc=nickc@redhat.com \
--cc=paulkoning@comcast.net \
/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