On Thu, Jul 18, 2024 at 7:27 PM Michal Hocko <mhocko@xxxxxxxx> wrote: > > On Thu 18-07-24 19:22:37, Barry Song wrote: > [...] > > For future-proofing and security reasons, returning NULL for NOFAIL > > still seems incorrect as the callers won't check the ret. If any future or > > existing in-tree code has a potential bug which might be exploited by > > hackers, for example > > > > ptr = kvmalloc_array(NOFAIL); > > ptr->callback(); //ptr=NULL; > > > > callback could be a privilege escalation? > > Only if you allow to map zero page AFAIK. Nobody reasonable should be > doing that. ptr->callback could be above /proc/sys/vm/mmap_min_addr ? > > -- > Michal Hocko > SUSE Labs