diff --git a/[refs] b/[refs] index a4e4a5b30535..f01cdd9e5800 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 268720903f87e0b84b161626c4447b81671b5d18 +refs/heads/master: 7a5bfb66b07f22d2429db776da7bb8b57bfb5cff diff --git a/trunk/kernel/events/uprobes.c b/trunk/kernel/events/uprobes.c index 4e0db3496d70..897417dbca8e 100644 --- a/trunk/kernel/events/uprobes.c +++ b/trunk/kernel/events/uprobes.c @@ -761,6 +761,16 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) if (!valid_vma(vma, is_register)) continue; + if (!prev && !more) { + /* + * Needs GFP_NOWAIT to avoid i_mmap_mutex recursion through + * reclaim. This is optimistic, no harm done if it fails. + */ + prev = kmalloc(sizeof(struct map_info), + GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN); + if (prev) + prev->next = NULL; + } if (!prev) { more++; continue;