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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 May 2013 16:56:46 +0900
From:	HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
To:	Vivek Goyal <vgoyal@...hat.com>
CC:	kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
	lisa.mitchell@...com, kumagai-atsushi@....nes.nec.co.jp,
	ebiederm@...ssion.com, zhangyanfei@...fujitsu.com,
	akpm@...ux-foundation.org, cpw@....com, jingbai.ma@...com
Subject: Re: [PATCH v4 5/8] vmcore: copy ELF note segments in the 2nd kernel
 per page vmcore objects

(2013/04/30 4:36), Vivek Goyal wrote:
> On Sat, Apr 13, 2013 at 09:21:33AM +0900, HATAYAMA Daisuke wrote:
>
> [..]
>> ELF notes are per-cpu, so total size of ELF note segments increases
>> according to the number of CPUs. The current maximum number of CPUs on
>> x86_64 is 5192, and there's already system with 4192 CPUs in SGI,
>> where total size amounts to 1MB. This can be larger in the neare
>> futrue or possibly even now on another architecture. Thus, to avoid
>> the case where memory allocation for large block fails, we allocate
>> vmcore objects per pages.
>
> IIRC, eric had suggested using vmalloc() and remap_vmalloc_range(). What's
> wrong with that? That should keep your vc_list relatively smaller.
>

Yes, it's handy if it's possible to remap them in vmalloc space, but the 
problem here is that remap_vmalloc_range requires the first argument vma 
to cover full range of the requested map. This becomes problem when 
requested area for mmap() overlaps multiple objects, for example, ELF 
headers and memory refered to by the first PT_LOAD program header.

To use remap_vmalloc_range, it's necessary to prepare a new variant 
similar to remap_pfn_range by which we can remap different objects 
separately to a single vma.

/**
  *      remap_vmalloc_range  -  map vmalloc pages to userspace
  *      @vma:           vma to cover (map full range of vma)
  *      @addr:          vmalloc memory
  *      @pgoff:         number of pages into addr before first page to map
  *
  *      Returns:        0 for success, -Exxx on failure
  *
  *      This function checks that addr is a valid vmalloc'ed area, and
  *      that it is big enough to cover the vma. Will return failure if
  *      that criteria isn't met.
  *
  *      Similar to remap_pfn_range() (see mm/memory.c)
  */
int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
                                                 unsigned long pgoff)


-- 
Thanks.
HATAYAMA, Daisuke

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