Skip to content
  • Daniel Borkmann's avatar
    net: filter: add __GFP_NOWARN flag for larger kmem allocs · 658da937
    Daniel Borkmann authored
    
    
    When seccomp BPF was added, it was discussed to add __GFP_NOWARN
    flag for their configuration path as f.e. up to 32K allocations are
    more prone to fail under stress. As we're going to reuse BPF API,
    add __GFP_NOWARN flags where larger kmalloc() and friends allocations
    could fail.
    
    It doesn't make much sense to pass around __GFP_NOWARN everywhere as
    an extra argument only for seccomp while we just as well could run
    into similar issues for socket filters, where it's not desired to
    have a user application throw a WARN() due to allocation failure.
    
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Cc: Nicolas Schichan <nschichan@freebox.fr>
    Cc: Alexei Starovoitov <ast@plumgrid.com>
    Cc: Kees Cook <keescook@chromium.org>
    Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    658da937