From patchwork Wed Jun 24 07:28:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 6666151 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93632C05AC for ; Wed, 24 Jun 2015 07:28:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD41520616 for ; Wed, 24 Jun 2015 07:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89A9E2045E for ; Wed, 24 Jun 2015 07:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751037AbbFXH2n (ORCPT ); Wed, 24 Jun 2015 03:28:43 -0400 Received: from mail-db3on0057.outbound.protection.outlook.com ([157.55.234.57]:19260 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750868AbbFXH2m convert rfc822-to-8bit (ORCPT ); Wed, 24 Jun 2015 03:28:42 -0400 Received: from DB4PR02MB272.eurprd02.prod.outlook.com (10.242.194.153) by DB4PR02MB0431.eurprd02.prod.outlook.com (10.141.43.25) with Microsoft SMTP Server (TLS) id 15.1.195.15; Wed, 24 Jun 2015 07:28:38 +0000 Received: from DB4PR02MB272.eurprd02.prod.outlook.com ([10.242.194.153]) by DB4PR02MB272.eurprd02.prod.outlook.com ([10.242.194.153]) with mapi id 15.01.0195.005; Wed, 24 Jun 2015 07:28:38 +0000 From: Noam Camus To: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "vgupta@synopsys.com" , Gilad Ben Yossef , Chris Metcalf , Andreas Dilger Subject: Re: [PATCH] fs: heap/bss calculation ignore special section. Thread-Topic: [PATCH] fs: heap/bss calculation ignore special section. Thread-Index: AQHQorBXIqdmneoOzEuEhAEQ/vkY7527VuVr Date: Wed, 24 Jun 2015 07:28:38 +0000 Message-ID: References: <1433853139-28554-1-git-send-email-noamc@ezchip.com> In-Reply-To: <1433853139-28554-1-git-send-email-noamc@ezchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: synopsys.com; dkim=none (message not signed) header.d=none; x-originating-ip: [85.64.58.22] x-microsoft-exchange-diagnostics: 1; DB4PR02MB0431; 5:ofJY0b6hokTbeghCXO7G8sIxZgU9xcWx85XDTTeioNGgZY137F9R6th8ZOCws5UYTRAIkCwqZl6TKYW5Rt4kvLaaOgWk274yQ/lWRZmJdL5K0tVkucTd8Se6fmNJax92T2uEcXc2WJpFZDFvNh8j7Q==; 24:hzu29LkUHGb7ec001ZbCSncHXHXRauYO9c3vEfO+Pto42KBXmdFkmCTgdLE4V917W0wF+mShgpHDgWj19dEztyQHoLJa/bB+BYLtbICgQ1g=; 20:oytByS87dFLR4F2XuOLEKzFawdSc4q3Zl7cvSFNFLSDrVRclbfVVXswAaDP7he2obJpiT1oqvC2XFnXhW3aP+A== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB4PR02MB0431; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DB4PR02MB0431; BCL:0; PCL:0; RULEID:; SRVR:DB4PR02MB0431; x-forefront-prvs: 061725F016 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(377454003)(5001770100001)(5002640100001)(62966003)(77156002)(92566002)(5003600100002)(2656002)(87936001)(46102003)(2900100001)(2950100001)(76576001)(5001960100002)(2501003)(189998001)(122556002)(77096005)(66066001)(102836002)(33656002)(86362001)(106116001)(40100003)(50986999)(76176999)(19580405001)(19580395003)(54356999)(74316001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR02MB0431; H:DB4PR02MB272.eurprd02.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2015 07:28:38.7060 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR02MB0431 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Andreas Dilger suggested that my previous email may be discarded due to my Sender Policy Framework (SPF) . So I email this from different location, just in case. Noam diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 241ef68..09f9483 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -962,6 +962,9 @@ static int load_elf_binary(struct linux_binprm *bprm) k = elf_ppnt->p_vaddr + elf_ppnt->p_filesz; + if (k >= STACK_TOP) + continue; + if (k > elf_bss) elf_bss = k; if ((elf_ppnt->p_flags & PF_X) && end_code < k)