Re: [PATCH net] bpf/xskmap: Return ERR_PTR for failure case instead of NULL.

2019-09-25 Thread Daniel Borkmann
On Tue, Sep 24, 2019 at 09:30:44PM +0200, Björn Töpel wrote: > On 2019-09-24 18:25, Jonathan Lemon wrote: > > When kzalloc() failed, NULL was returned to the caller, which > > tested the pointer with IS_ERR(), which didn't match, so the > > pointer was used later, resulting in a NULL dereference. >

Re: [PATCH net] bpf/xskmap: Return ERR_PTR for failure case instead of NULL.

2019-09-24 Thread Björn Töpel
On 2019-09-24 18:25, Jonathan Lemon wrote: When kzalloc() failed, NULL was returned to the caller, which tested the pointer with IS_ERR(), which didn't match, so the pointer was used later, resulting in a NULL dereference. Return ERR_PTR(-ENOMEM) instead of NULL. Reported-by: syzbot+491c1b7565b

[PATCH net] bpf/xskmap: Return ERR_PTR for failure case instead of NULL.

2019-09-24 Thread Jonathan Lemon
When kzalloc() failed, NULL was returned to the caller, which tested the pointer with IS_ERR(), which didn't match, so the pointer was used later, resulting in a NULL dereference. Return ERR_PTR(-ENOMEM) instead of NULL. Reported-by: syzbot+491c1b7565ba9069e...@syzkaller.appspotmail.com Fixes: 04

[PATCH net] bpf/xskmap: Return ERR_PTR for failure case instead of NULL.

2019-09-24 Thread Jonathan Lemon
When kzalloc() failed, NULL was returned to the caller, which tested the pointer with IS_ERR(), which didn't match, so the pointer was used later, resulting in a NULL dereference. Return ERR_PTR(-ENOMEM) instead of NULL. Reported-by: syzbot+491c1b7565ba9069e...@syzkaller.appspotmail.com Fixes: 04