Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7037277ybi; Thu, 13 Jun 2019 08:31:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7S9G9GBdvZKRr3EZMQJyfz/mF8zsy/42cOFZGdY8N2B2rqZY/SAq43XghmxBqrpFBSYUQ X-Received: by 2002:a17:902:b944:: with SMTP id h4mr85889126pls.179.1560439883508; Thu, 13 Jun 2019 08:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439883; cv=none; d=google.com; s=arc-20160816; b=Dap/CY9W6J0pv/XQuety+5NZGo0/pXErZ93/S89L+5lpBhhTyJbTmlgxaxxOdESBRF 50sqyHBHr7Yl8QaPmH46Wl1n90DcLSoyLWGlX6VYhSGM6fkdeQ/X0wjFlACT00jFTRxS VaSU6Im5xfi+/qtBE7Gf/3ioy0lUCV/JVus8xVWzlbH+aVAdp/ZMk6q6eqp1hthE0Y/u DY0AqqWQdubYgiD20GWnbcb7/u4FGwTzdpPHztpEIsGwo9R9r3EP4wvAeulJRQbSGyZz AVipx4BeQS+qDzEi89VwLqi2UYHiqYC5glr5LhKA1yCyxjQKqV57ocQ1kQlNF3x60PBt SKPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:message-id:date:cc:to:from; bh=hPgU8xk+3/CfM6rD7ePW8iofZ6gUgxzC7QKcZgf1t3c=; b=tqK3bmaT4NIzVEOGsHdBcJe0V9FjjxoCk8x2FFama2QvIPUZLXmhtmjhLJP08VVaSv U/whUlFjh01+CTudgQDdWVOcbQ0aNU6n/ejb7uWHB7npeKSvYHgfaOIWVMlO1rU25Dhz JduZ18b94XaoZmhA7RcsRNTC27DV73c+BJbypWOR4jXvY4keL13ZIbrzkukd86IISkWy u4MOIP/4JjLzs/nvCUdoTvJCi2q45yfVS8W7ThVaOcfc/8T4i5+/6HQBbC4NU5X8ubRC wNFbIKs1Qkgf/V5ypSvZdvLyp1RRgPp0RU1ww51WrtQXi/S9lQ5QkRYUusxHH1gxuFVa UAOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si71051pgs.457.2019.06.13.08.31.07; Thu, 13 Jun 2019 08:31:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728044AbfFMP3K (ORCPT + 99 others); Thu, 13 Jun 2019 11:29:10 -0400 Received: from ou.quest-ce.net ([195.154.187.82]:36461 "EHLO ou.quest-ce.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728884AbfFML0M (ORCPT ); Thu, 13 Jun 2019 07:26:12 -0400 Received: from [2a01:e35:39f2:1220:9dd7:c176:119b:4c9d] (helo=test.quest-ce.net) by ou.quest-ce.net with esmtpsa (TLS1.1:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1hbNrs-00086j-QA; Thu, 13 Jun 2019 13:26:08 +0200 From: Yann Droneaud To: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Cc: Andrew Morton , Kees Cook , Alexey Dobriyan , Yann Droneaud Date: Thu, 13 Jun 2019 13:26:03 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a01:e35:39f2:1220:9dd7:c176:119b:4c9d X-SA-Exim-Mail-From: ydroneaud@opteya.com X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ou.quest-ce.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH 0/3] ELF interpretor info: align and add random padding X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ou.quest-ce.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, The following patches are mostly focused on ensuring AT_RANDOM array is aligned on 16bytes boundary, and while being located at a pseudo-random offset on stack (at most 256 bytes). This patchset also insert a random sized (at most 15 bytes) padding between AT_RANDOM and AT_PLATFORM and/or AT_BASE_PLATFORM. It also insert a random sized padding (at most 256 bytes) between those data and the arrays passed to userspace (argv[] + environ[] + auxv[]) as defined by ABI. Adding random padding around AT_RANDOM, AT_PLATFORM, AT_BASE_PLATEFORM should be viewed as an exercise of cargo-cult security as I'm not aware of any attack that can be prevented with this mechanism in place. Regards. Yann Droneaud (3): binfmt/elf: use functions for stack manipulation binfmt/elf: align AT_RANDOM array binfmt/elf: randomize padding between ELF interp info fs/binfmt_elf.c | 110 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 24 deletions(-) -- 2.21.0