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]
Message-ID: <dc1fed82-d0dd-9dd3-d33c-1225ea7b80c3@canonical.com>
Date:   Tue, 15 Sep 2020 18:14:42 +0100
From:   Colin Ian King <colin.king@...onical.com>
To:     Sean Young <sean@...s.org>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Maxim Levitsky <maximlevitsky@...il.com>,
        linux-media@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: rc: fix check on dev->min_timeout for
 LIRC_GET_MIN_TIMEOUT ioctl

On 15/09/2020 18:12, Sean Young wrote:
> On Tue, Sep 15, 2020 at 04:36:08PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@...onical.com>
>>
>> Currently the LIRC_GET_MIN_TIMEOUT is checking for a null dev->max_timeout
>> and then accessing dev->min_timeout, hence we may have a potential null
>> pointer dereference issue.  This looks like a cut-n-paste typo, fix it
>> by checking on dev->min_timeout before accessing it.
> 
> max_timeout and min_timeout are both u32, not pointers. So, the commit 
> message is wrong: there is no null pointer dereference issue.
> 
> Every driver which has max_timeout also has min_timeout set (I've checked
> for this). So technically this is not wrong, but maybe it looks wrong?

Oops. I totally misread the analysis report. My bad.

> 
> Thanks,
> 
> Sean
>>
>> Addresses-Coverity: ("Copy-paste error")
>> Fixes: e589333f346b ("V4L/DVB: IR: extend interfaces to support more device settings")
>> Signed-off-by: Colin Ian King <colin.king@...onical.com>
>> ---
>>  drivers/media/rc/lirc_dev.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
>> index 220363b9a868..d230c21e1d31 100644
>> --- a/drivers/media/rc/lirc_dev.c
>> +++ b/drivers/media/rc/lirc_dev.c
>> @@ -533,7 +533,7 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>>  
>>  	/* Generic timeout support */
>>  	case LIRC_GET_MIN_TIMEOUT:
>> -		if (!dev->max_timeout)
>> +		if (!dev->min_timeout)
>>  			ret = -ENOTTY;
>>  		else
>>  			val = dev->min_timeout;
>> -- 
>> 2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ