From patchwork Fri Jan 22 13:57:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 74628 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0MDw58g021893 for ; Fri, 22 Jan 2010 13:58:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575Ab0AVN6D (ORCPT ); Fri, 22 Jan 2010 08:58:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752144Ab0AVN6B (ORCPT ); Fri, 22 Jan 2010 08:58:01 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:46866 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575Ab0AVN6A (ORCPT ); Fri, 22 Jan 2010 08:58:00 -0500 Received: by bwz27 with SMTP id 27so1077163bwz.21 for ; Fri, 22 Jan 2010 05:57:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=K79RzCp7+iLBuaY7eG7neAmT/9QO5M51jafAIT/LRyI=; b=Z5W9wvHhM8DxjxktOfumM+/A5unLGaMCwUwtYNXSnUmi2HUHkyrcHMX3YleqLB1E6P KK3rU85LAwDz+fXUIknMQ6LGV+DY8LnbbumqnkeZm1300JAM5EtH+A+qYJ+Uy328fZ5/ D9jPEPOoVkFI1Bg+L+fkFLQi3RKnhl25P8t6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=S+W99BfBPL/aceFxAKirG+u0qw0we022glAoE8NH0O8vWgWp9KU8vWPLo8HvblOlxJ pro8Jam1lWI0EipRbjfkXiGJUXw2+wJl0F49C4Bvmgima/SwIUvtVpyXZhnmGc1J6YmK eDdEzUDNlRuJNJ5ceESRUbXKEsUstYtX0VZqY= MIME-Version: 1.0 Received: by 10.204.10.149 with SMTP id p21mr1646870bkp.3.1264168678936; Fri, 22 Jan 2010 05:57:58 -0800 (PST) Date: Fri, 22 Jan 2010 13:57:58 +0000 Message-ID: <87a5b0801001220557s3a62742n369741a5d0e3ef94@mail.gmail.com> Subject: [PATCH] exec: Use a define for maximum process stack size in STACK_GROWSUP case. From: Will Newton To: Linux Kernel list , linux-parisc@vger.kernel.org Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/fs/exec.c b/fs/exec.c index 632b02e..d37a626 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -573,10 +573,13 @@ int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_base; #ifdef CONFIG_STACK_GROWSUP - /* Limit stack size to 1GB */ + /* Limit stack size to 1GB by default. */ +#ifndef STACK_MAX_SIZE +#define STACK_MAX_SIZE (1 << 30) +#endif stack_base = current->signal->rlim[RLIMIT_STACK].rlim_max; - if (stack_base > (1 << 30)) - stack_base = 1 << 30; + if (stack_base > STACK_MAX_SIZE) + stack_base = STACK_MAX_SIZE; /* Make sure we didn't let the argument array grow too large. */ if (vma->vm_end - vma->vm_start > stack_base)