Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbdGSJnP (ORCPT ); Wed, 19 Jul 2017 05:43:15 -0400 Received: from namei.org ([65.99.196.166]:39703 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269AbdGSJnN (ORCPT ); Wed, 19 Jul 2017 05:43:13 -0400 Date: Wed, 19 Jul 2017 19:42:53 +1000 (AEST) From: James Morris To: Kees Cook cc: Andrew Morton , Linus Torvalds , David Howells , "Eric W. Biederman" , John Johansen , "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Casey Schaufler , Tetsuo Handa , James Morris , Andy Lutomirski , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 14/15] exec: Use sane stack rlimit under secureexec In-Reply-To: <1500416736-49829-15-git-send-email-keescook@chromium.org> Message-ID: References: <1500416736-49829-1-git-send-email-keescook@chromium.org> <1500416736-49829-15-git-send-email-keescook@chromium.org> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 540 Lines: 24 On Tue, 18 Jul 2017, Kees Cook wrote: > For a secureexec, before memory layout selection has happened, reset the > stack rlimit to something sane to avoid the caller having control over > the resulting layouts. > > $ ulimit -s > 8192 > $ ulimit -s unlimited > $ /bin/sh -c 'ulimit -s' > unlimited > $ sudo /bin/sh -c 'ulimit -s' > 8192 > > Cc: Linus Torvalds > Signed-off-by: Kees Cook Reviewed-by: James Morris -- James Morris