Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp42777ybg; Sat, 25 Jul 2020 19:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO1wgVEs6FL5pWO4ooL7cjBt5XxuNc3qv+cdSylxketkfK688l0y/pLEC2TWai6bckOqlB X-Received: by 2002:a05:6402:3058:: with SMTP id bu24mr15355959edb.242.1595729350476; Sat, 25 Jul 2020 19:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595729350; cv=none; d=google.com; s=arc-20160816; b=Vz67mbXmvlYiRtDiTdnv28uiXjsRvBc55BYgBixMA0kNs6UtrrsPNOmv4JROR6ntNK n+W3apXdGvcFtmrynSSKCM7bl5tiv1Ab9hsVF68++fuz6M8VkIW1sG+1baKu8FlPwOis OP+SUDg8mDSfIJc2KLvuSaSfaCFb1LLWf/ZWNASj/3szbDDgfLW1T8lezzatT6ffTzAn z0sTLtjv/CoL6jcZDYPPBwDuHDUN4/sz9cFe19Ot0GREhbg1WjgerLPOx8YQJEP1s33z NM7/4Ps/4x3fKNlT94gB4QYsKF33HYH2TyPduwaSfUuS5ys6ye41qN5JFmm1ls27c6+i x5Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PNDilay1sHPsEz4YR66Yr+U+zEImSfHeZ16zNl+dXoM=; b=zxZLrUjNlxOLB6Ou43AnZJXllWW1yvyCpkWulovGIR+eXbZrD3eklMYncyi5i5j+IZ rD/rQCEAgaRMBWDTAeKYYxmYiHg128ZUBGEEeRW6ZCddr0UHNMKroC3ln/dqkogMZKTn HsPT4r7qWTDGSmHZ/FOr6yjZ2gfacrS3ehslskyEgT1KrMIUvu0NOF/8nbyvesrBmBQ0 JXEzPdpFp5Etu05/i5RVW1QRy4r+ao26TRMSXQLXt67igRwXMwNitjh53WMvq8QtFt3s rUM7uAgdk85+Vjo/ccPiqBgq90CW9DNLW82XsYxCM89syw7qEeVkkYNdEtXcfnyOz7pV 0yBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OvvfwJdw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si3222987edx.581.2020.07.25.19.08.47; Sat, 25 Jul 2020 19:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OvvfwJdw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728076AbgGZCHl (ORCPT + 99 others); Sat, 25 Jul 2020 22:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbgGZCHk (ORCPT ); Sat, 25 Jul 2020 22:07:40 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8826C0619D2 for ; Sat, 25 Jul 2020 19:07:40 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id il6so1615804pjb.0 for ; Sat, 25 Jul 2020 19:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PNDilay1sHPsEz4YR66Yr+U+zEImSfHeZ16zNl+dXoM=; b=OvvfwJdw+GjOACNErXcyicqxzDz/7C8Y47ka18cmdrDcvqXqw22EcV7KQUQWYJg9eF 6nTa70zTxJqcVf1jPzvud8lx8RB2dzxgvYERrskJe7gObzxhkgZuB+Smp3E9VWrzoouk PB2moUvU8lM6WrkbK/TWNctP7yaEYw9kgL+C0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PNDilay1sHPsEz4YR66Yr+U+zEImSfHeZ16zNl+dXoM=; b=FwMmmuunrnbsazpnHQ89MA3vF8B6g30uTr9Q64L1bzJSyyOdSNN+JH2Tq8OPW6Pz5q SO32RrvSD4i9YtRcW8PhDHPE69xfptynmPg8BL7NCYPnOeOIkkpgW77jR1jWw77RYrx6 OJm9cGHS17IumZK5l+9Jf0qiZx2z7k/lul60dQCi7lPgHKS6fEAIM0iu0aDPHZbmri2f d1kva8NbfSMy21/hATidqyGWBU9CxsUUO0MOlDRVTP2V7nZC3fjw+wn6gLhDxI0uD8Me C8Ntjaujm1skG1y6OMXKYchnOEGXwg/FZ7rheATj1T3yeXDFWgqzhJ2U6mTlkNiAf1Ak wXGA== X-Gm-Message-State: AOAM532UqVMTH8rYuxhK31bQzMaFPoi0WLBrAt/P24G2ch1civ91fwLF pdgtNfcVCnV8CHbCxUihsfe0Lw== X-Received: by 2002:a17:902:c80c:: with SMTP id u12mr13809216plx.196.1595729260131; Sat, 25 Jul 2020 19:07:40 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q5sm10614791pfc.130.2020.07.25.19.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jul 2020 19:07:38 -0700 (PDT) Date: Sat, 25 Jul 2020 19:07:37 -0700 From: Kees Cook To: Ben Hutchings Cc: Dan Carpenter , Christian Kujau , Alexey Dobriyan , Andrew Morton , Willy Tarreau , linux-kernel@vger.kernel.org, klibc@lists.zytor.com, "H. Peter Anvin" Subject: Re: process '/usr/bin/rsync' started with executable stack Message-ID: <202007251907.DC4D4C6C15@keescook> References: <20200624165148.GD31008@kadam> <202006241238.E9CB1CE85B@keescook> <20200625100429.GB2571@kadam> <202006251253.2893D4F67@keescook> <6898a5af75e165fb9524558804fca9f46f98b633.camel@decadent.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6898a5af75e165fb9524558804fca9f46f98b633.camel@decadent.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 25, 2020 at 10:27:56PM +0100, Ben Hutchings wrote: > On Thu, 2020-06-25 at 13:20 -0700, Kees Cook wrote: > > On Thu, Jun 25, 2020 at 01:04:29PM +0300, Dan Carpenter wrote: > > > On Wed, Jun 24, 2020 at 12:39:24PM -0700, Kees Cook wrote: > > > > On Wed, Jun 24, 2020 at 07:51:48PM +0300, Dan Carpenter wrote: > > > > > In Debian testing the initrd triggers the warning. > > > > > > > > > > [ 34.529809] process '/usr/bin/fstype' started with executable stack > > > > > > > > Where does fstype come from there? I am going to guess it is either > > > > busybox or linked against klibc? > > > > > > > > klibc has known problems with executable stacks due to its trampoline > > > > implementation: > > > > https://wiki.ubuntu.com/SecurityTeam/Roadmap/ExecutableStacks > > > > > > Yeah. It comes from klibc-utils. > > > > This is exactly what I was worried about back in Feb: > > https://lore.kernel.org/lkml/202002251341.48BC06E@keescook/ > > > > This warning, combined with klibc-based initrds, makes the whole thing > > pointless because it will always warn once on boot for the klibc stack, > > and then not warn about anything else after that. > > > > It looks like upstream klibc hasn't been touched in about 4 years, and > > it's been up to Ben to keep it alive in Debian. > > > > A couple ideas, in order of my preference: > > > > 1) stop using klibc-utils[1]. initramfs-tools-core is the only thing with a > > dependency on klibc-utils. Only a few things are missing from busybox. > > > > 2) make the warning rate-limited instead? > > > > 3) fix the use of trampolines in klibc > > It only uses trampolines on alpha, m68k, parisc, s390, and sparc32. As > of today, the master branch should correctly enable executable stacks > on these and only these architecture. > > I have a development branch that sets sa_restorer and disables > executable stacks on alpha, s390, and sparc32: > > https://git.kernel.org/pub/scm/libs/klibc/klibc.git/log/?h=execstack-fixes Awesome! Thanks for tackling this. :) -- Kees Cook