From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18835 invoked from network); 10 Jun 2020 10:40:01 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 10 Jun 2020 10:40:01 -0000 Received: (qmail 26474 invoked by uid 550); 10 Jun 2020 10:39:59 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 26454 invoked from network); 10 Jun 2020 10:39:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=Ay8dWmiptbNOOZhMb/6cn/zUgQsbe4vJOr+px3EF2Sc=; b=h05HnYXFWsD9KlhEjN7iK2AImKcj3vh54BT7JAx78a1iaRl/ImfH9ozpXM1FFQdLrU zfVqjnq0DFFAAauP3v5d0MVnVYbgaZGXhJOlDlTZ7gPXYH/dh65mddS83ZzrXZGmc32R WLWxy7CBRHjdWP3NSy54okcKDAJzsZjtBdQNSCJ9QHevipTsgcrEs9OIMeVKwcWsW8l7 +NWEZBhjKs5DWOoLK0F+rIJGplTNqvduXP/4bUVKZwRQgHpI9qriLjMCmbh6eB0iFQ1c iwRQHDjr1DxXOEaBsqBBhP+HYjZb9CfVKnyjUiF9RMf9NeK2Bp6dctaTkOTXH6PKTM0w gx8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=Ay8dWmiptbNOOZhMb/6cn/zUgQsbe4vJOr+px3EF2Sc=; b=DBFm1XEtAWfJujgtLdQy6woYVa967pn9ZO7dE0bIzqcXya46TDpHRt2w+UTKediHjH zGr/ppoF6Enpiv96CQcOTLpHFsh/xnas71fGqc4M7f1x8uW8K10gZezee9mh+YaUzyyZ 6K2yWcQolGBS23mq/9FnVLsYEKXNOUev6rD9PqpwUk1VgUl7gKnZl/MGoH4ZcKXsrZAx pnvOPdPPv4Lp0XtG65Zy8hpw6z1gXCqHehS62TY5N11dFevS7dKn0vvZYtojvwmi22IR Llf9zUMXVEOWRhKoRKZpK8QD3faJe7HT5SBaTYUNzVEORcxYVdmdWeOjl5X2oQuIERvJ 8C6A== X-Gm-Message-State: AOAM532tVBaLti16sd3hNznMaMyD8jR9q4JLPmmTq1Bst6BcvcF31JCn 3MPxQ/ydNGH/Ap7lp83y85X+nepetwl5l9f4DrcfCNg3 X-Google-Smtp-Source: ABdhPJzAlNWUGsbfSEZ6qV3b2TPQB9Ph8B2i1LLCK9X2u65hNdUXTqWOED7i3z4vFTUp//I5xp2JlgT0CHXVsn7QFKU= X-Received: by 2002:a6b:ef1a:: with SMTP id k26mr2589261ioh.124.1591785587153; Wed, 10 Jun 2020 03:39:47 -0700 (PDT) MIME-Version: 1.0 References: <20200610103102.GF871552@port70.net> In-Reply-To: <20200610103102.GF871552@port70.net> From: Jeffrey Walton Date: Wed, 10 Jun 2020 06:39:35 -0400 Message-ID: To: musl@lists.openwall.com, Norbert Lange Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Mark stack as non-executable in asm On Wed, Jun 10, 2020 at 6:31 AM Szabolcs Nagy wrote: > > * Norbert Lange [2020-06-10 11:24:04 +0200]: > > I did borrow some assembler files to avoid having to link against > > (any) libc. That was for building a DSO, ultimately loaded via glibc. > > The effect was that glibc did change the protection of all stacks to > > be executable. > > > > Would you consider adding the line [1] > > .section .note.GNU-stack, "", %progbits > > to assembly files? > > > > I know this is not a musl bug, and I can easily add the lines myself. > > musl build system (just like other libcs i know of) > pass -noexecstack to the assembler so if you build > the asm files as part of libc the object files should > have the marking, if you build outside of libc i > think it's your responsibility to add the note > (either to the asm or via the -Wa,-noexecstack flag) > > readelf -lW libfoo.so | grep GNU_STACK > > is one way to verify that everything has the note. It may be worth mentioning, according to the Binutil folks, the stack size has to be 0. A non-0 stack size means executable stacks are in effect. In the case of non-0, I believe the loader is responsible for loss of the nx-stack. Jeff