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-next>] [day] [month] [year] [list]
Message-Id: <8138c533-dae2-6a6a-fabd-d090b72d4d99@linux.vnet.ibm.com>
Date:   Fri, 30 Jun 2017 11:59:37 +0530
From:   Anshuman Khandual <khandual@...ux.vnet.ibm.com>
To:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Alexander Viro <viro@...iv.linux.org.uk>
Subject: Question regarding MAX_ARG_STRLEN with execve()

Hello,

execve() system call should support argument length of
MAX_ARG_STRLEN (PAGE_SIZE * 32). On 64K page size systems, we
are not able to pass 32 * PAGE_SIZE arguments into the execve()
system call because of the following reasons.

* struct linux_binprm's vma starts with a size of PAGE_SIZE

	vma->vm_end = STACK_TOP_MAX;
	vma->vm_start = vma->vm_end - PAGE_SIZE;

* The VMA expands as much depending upon the argument size. So
  for 32 * PAGE_SIZE argument, it becomes 33 * PAGE_SIZE.

* 33 * PAGE_SIZE with 64K pages fails the following test in
  get_arg_page() function. 33 * PAGE_SIZE is more than 2MB
  (8 MB /4) with 64K page size.

   if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur) / 4)

* Right now RLIMIT_STACK is hard coded 8MB which does not take
  PAGE_SIZE into account. 

Wondering what should be the solution for this problem ?

* Change the default stack size from 8MB ?
* Change the ratio test from 1/4th ?

Thoughts ?

Regards
Anshuman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ