Re: current->mm == NULL in security_vm_enough_memory().

From: Alan Cox
Date: Tue Apr 14 2009 - 14:02:31 EST


If you want to permit a NULL vm you can use vm_enough_memory_kern() to
indicate that the caller may be a kernel thread and you are ok with that.

The case you are now hitting was considered in the original design and
provided for. The default handler traps NULL to be sure we catch cases
where nobody has considered if NULL mm is meaningful and valid (such as
old code pre the checks)

Given this case appears to be ok (if a bit novel by the kernels
standards) just flipping to use the _kern() version will do the job.

Alan

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