lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 24 Jun 2015 07:28:38 +0000
From:	Noam Camus <noamc@...hip.com>
To:	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"vgupta@...opsys.com" <vgupta@...opsys.com>,
	Gilad Ben Yossef <giladb@...hip.com>,
	Chris Metcalf <cmetcalf@...hip.com>,
	Andreas Dilger <adilger@...ger.ca>
Subject: Re: [PATCH] fs: heap/bss calculation ignore special section.

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
________________________________________
From: Noam Camus
Sent: Tuesday, June 9, 2015 3:32 PM
To: linux-fsdevel@...r.kernel.org; linux-kernel@...r.kernel.org
Cc: vgupta@...opsys.com; Gilad Ben Yossef; Chris Metcalf; Noam Camus
Subject: [PATCH] fs: heap/bss calculation ignore special section.

From: Noam Camus <noamc@...hip.com>

Today bss/heap is placed above last loaded sections.
However if STACK_TOP is not equal to TASK_SIZE we wish to ignore
such sections mapped to this gap between STACK_TOP and TASK_SIZE.
set_brk will never work for such case.

So at the moment this addition is just a sanity check.

An alternative (more complex):
Linux would make use of LMA field in ELF, then we can set VMA below
STACK_TOP and set LMA to be between STACK_TOP and TASK_SIZE to match
such special memory mapping.

Signed-off-by: Noam Camus <noamc@...hip.com>
---
 fs/binfmt_elf.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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)
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ