From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 42AB83858D32; Wed, 12 Apr 2023 16:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42AB83858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7CDB0D75; Wed, 12 Apr 2023 09:53:19 -0700 (PDT) Received: from [10.2.78.76] (unknown [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5EF633F73F; Wed, 12 Apr 2023 09:52:34 -0700 (PDT) Message-ID: Date: Wed, 12 Apr 2023 17:52:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: RFC: Adding a SECURITY.md document to the Binutils Content-Language: en-GB To: Siddhesh Poyarekar , Nick Clifton , Binutils Cc: "gdb@sourceware.org" References: <1c38b926-e003-0e21-e7f1-3d5dbec2aabf@redhat.com> <5b147005-bd28-4cf9-b9e7-479ef02cb1ad@foss.arm.com> <5d044987-39eb-a060-1b2b-9d07b1515e7d@gotplt.org> From: Richard Earnshaw In-Reply-To: <5d044987-39eb-a060-1b2b-9d07b1515e7d@gotplt.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3487.0 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,MEDICAL_SUBJECT,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/04/2023 17:26, Siddhesh Poyarekar wrote: > On 2023-04-12 12:02, Richard Earnshaw wrote: >> >> >> On 07/04/2023 09:42, Nick Clifton via Binutils wrote: >>> Hi Guys, >>> >>>    Many open source projects have a SECURITY.md file which explains >>>    their stance on security related bugs.  So I thought that it would >>>    be a good idea if we had one too.  The top level file would actually >>>    just be a placeholder, like this: >>> >>> ------------- ./SECURITY.md ------------------------------------------ >>> For details on the Binutils security process please see >>> the SECURITY.md file in the binutils sub-directory. >>> >>> For details on the GDB security process please see >>> the SECURITY.md file in the gdb sub-directory. >>> -------------------------------------------------------------------- >>> >>>    So this email is mostly about the wording for the Binutils specific >>>    version.  Here is my current proposal: >>> >>> ---------------- binutils/SECURITY.md ------------------------------ >>> Binutils Security Process >>> ========================= >>> >>> What is a binutils security bug? >>> ================================ >>> >>>     A security bug is one that threatens the security of a system or >>>     network.  In the context of the GNU Binutils this means a bug that >>>     relates to the creation of corrupt output files from valid, trusted >>>     inputs.  Even then the bug would only have a security impact if the >>>     the code invokes undefined behaviour or results in a privilege >>>     boundary being crossed. >>> >>>     Other than that, all other bugs will be treated as non-security >>>     issues.  This does not mean that they will be ignored, just that >>>     they will not be given the priority that is given to security bugs. >>> >>>     This stance applies to the creation tools in the GNU Binutils (eg >>>     as, ld, gold, objcopy) and the libraries that they use.  Bugs in >>>     inspection tools (eg readelf, nm objdump) will not be considered >>>     to be security bugs, since they do not create executable output >>>     files.  When used on untrusted inputs, these inspection tools >>>     should be appropriately sandboxed to mitigate potential damage >>>     due to any malicious input files. >> >> I'd expect that any program used on untrusted input to be run only at >> user-level privileges.  So we should exclude issues where an account >> with elevated privileges (eg root) is used with either inspection or >> generation tools. > > Agreed, I think this should be addressed by the "or results in a > privilege boundary being crossed".  By running these programs as root, > the user is elevating privileges themselves, so it's not a binutils > problem. My reading of the text is that "privilege boundary being crossed" (in the first paragraph) is specifically related to the generated output, not to the program itself being run with elevated privileges. > > Perhaps it's necessary to educate users to not run these programs as > root, but I don't think it is the intent of SECURITY.md to educate users > about secure usage.  The intent is to define context by describing what > constitutes security-relevant bugs and then document mechanisms to reach > out to communicate those bugs in case they're sensitive. > >> The other area of concern is where the tools (particularly the linker) >> 'generate' code; so bugs in the opcodes the assembler generates (eg by >> not setting some don't care bits to something safe) or with code >> generated by the linker to glue functions together (relocation >> handling, PLTs, veneers, etc) would also count. > > Ack, I reckon this should be addressed by "corrupt output files from > valid trusted inputs".  If that's not clear enough, could you suggest > alternative phrasing that makes it clearer? I'm not sure corrupt is general enough. Each instruction in the binary might be completely legal, but their sequencing could leave some vulnerabilities (think spectre, for example, but that's pretty extreme). Perhaps something like "... this means that the tools introduce a vulnerability in the output file that was not present in the input files being processed". I think with that wording you probably don't even need the last sentence in the first paragraph. R. > > Thanks, > Sid