lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 13 Jan 2022 11:12:10 +0100
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, dwlsalmeida@...il.com,
        mchehab@...nel.org
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: vidtv: Check for null return of vzalloc

On 12/01/2022 03:07, Jiasheng Jiang wrote:
> On Tue, Jan 11, 2022 at 05:58:10PM +0800, Hans Verkuil wrote:
>> This doesn't free e->name!
>>
>> Actually, the same issue is also present later in this function:
>>
>> ctx = kzalloc(priv_sz, GFP_KERNEL);
>>        if (!ctx) {
>> 	        kfree(e);
>> 	        return NULL;
>> 	}
> 
>>> +		kfree(e);
>>> +		return NULL;
>>> +	}
> 
> Thanks for your reminder.
> I have sent a v2 to fix it.
> And also I have sent a patch to fix the 'ctx' with
> 'Reported-by: Hans Verkuil <hverkuil@...all.nl>',
> since they are two different things.

Actually no. It's all the same thing: not correctly freeing allocated memory
in a function.

Please combine it all in a single patch.

Perhaps this should use the 'goto' method of cleaning up after errors instead
of duplicating kfree()s in two places. A bit borderline what works best here.

Regards,

	Hans

> 
> Sincerely thanks,
> Jiang
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ