Re: [PATCH RFC] mm: warn potential return NULL for kmalloc_array and kvmalloc_array with __GFP_NOFAIL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux