Date: Mon, 22 Aug 2011 13:45:58 +0400 From: Vasiliy Kulikov <segoon@...nwall.com> To: kernel-hardening@...ts.openwall.com Subject: Re: kmalloc() nofail allocations Solar, On Mon, Aug 22, 2011 at 13:38 +0400, Solar Designer wrote: > On Mon, Aug 22, 2011 at 01:24:29PM +0400, Vasiliy Kulikov wrote: > > Major problem with the idea in general: > ... > > Unlikely, but fully possible case - we want some memory and the OOM killer > > kills us for our wish. > > How/why is this a major problem with the idea in general? I am probably > missing something. Initially I wanted to "wrap" kmalloc calls, which cannot fail in any case. This would not change any mm code, but the caller (its expectation). Now I see that it's impossible without any mm code changes. It needs at least __GFP_NOFAIL flag addition, which is explicitly marked as "no new uses". Such kmalloc_nofail() wouldn't differ much from kmalloc(size, flags | __GFP_NOFAIL). Thanks, -- Vasiliy
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.