lkml.org 
[lkml]   [2021]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 066/190] Revert "bpf: Remove unnecessary assertion on fp_old"
From
Date
On 4/27/21 7:58 PM, Greg Kroah-Hartman wrote:
> On Wed, Apr 21, 2021 at 02:59:01PM +0200, Greg Kroah-Hartman wrote:
[...]
>> kernel/bpf/core.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
>> index 75244ecb2389..da29211ea5d8 100644
>> --- a/kernel/bpf/core.c
>> +++ b/kernel/bpf/core.c
>> @@ -230,6 +230,8 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
>> struct bpf_prog *fp;
>> u32 pages;
>>
>> + BUG_ON(fp_old == NULL);
>> +
>> size = round_up(size, PAGE_SIZE);
>> pages = size / PAGE_SIZE;
>> if (pages <= fp_old->pages)
>
> The original commit here is correct, I'll drop this revert.

Ok, sounds good to me, thanks! (If there would ever be an incorrect fp_old with NULL, then at
latest we crash in fp_old->pages anyway, so the BUG_ON() was not needed.)

> thanks,
>
> greg k-h
>

\
 
 \ /
  Last update: 2021-04-27 21:29    [W:0.229 / U:2.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site