[PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-15 Thread Richard Weinberger
max_entries is user controlled and used as input for __alloc_percpu(). This function expects that the allocation size is a power of two and less than PCPU_MIN_UNIT_SIZE. Otherwise a WARN() is triggered. Fixes: 11393cc9b9be ("xdp: Add batching support to redirect map") Reported-by: Shankara Pailoor

Re: [PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-15 Thread Richard Weinberger
Am Montag, 16. Oktober 2017, 00:00:20 CEST schrieb Richard Weinberger: > max_entries is user controlled and used as input for __alloc_percpu(). > This function expects that the allocation size is a power of two and > less than PCPU_MIN_UNIT_SIZE. > Otherwise a WARN() is triggered. On a second thou

Re: [PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-16 Thread Daniel Borkmann
[ +Tejun, Mark, John ] On 10/16/2017 12:00 AM, Richard Weinberger wrote: max_entries is user controlled and used as input for __alloc_percpu(). This function expects that the allocation size is a power of two and less than PCPU_MIN_UNIT_SIZE. Otherwise a WARN() is triggered. Fixes: 11393cc9b9be

Re: [PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-16 Thread John Fastabend
On 10/15/2017 03:13 PM, Richard Weinberger wrote: > Am Montag, 16. Oktober 2017, 00:00:20 CEST schrieb Richard Weinberger: >> max_entries is user controlled and used as input for __alloc_percpu(). >> This function expects that the allocation size is a power of two and >> less than PCPU_MIN_UNIT_SIZ

Re: [PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-17 Thread Mark Rutland
On Mon, Oct 16, 2017 at 08:52:13PM +0200, Daniel Borkmann wrote: > [ +Tejun, Mark, John ] > > On 10/16/2017 12:00 AM, Richard Weinberger wrote: > > max_entries is user controlled and used as input for __alloc_percpu(). > > This function expects that the allocation size is a power of two and > > le

Re: [PATCH] bpf: devmap: Check attr->max_entries more carefully

2017-10-17 Thread Daniel Borkmann
On 10/17/2017 12:29 PM, Mark Rutland wrote: On Mon, Oct 16, 2017 at 08:52:13PM +0200, Daniel Borkmann wrote: [ +Tejun, Mark, John ] On 10/16/2017 12:00 AM, Richard Weinberger wrote: max_entries is user controlled and used as input for __alloc_percpu(). This function expects that the allocation