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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5683E84A.5000301@linaro.org>
Date:	Wed, 30 Dec 2015 22:20:58 +0800
From:	Bamvor Jian Zhang <bamvor.zhangjian@...aro.org>
To:	Arnd Bergmann <arnd@...db.de>, y2038@...ts.linaro.org
Cc:	gregkh@...uxfoundation.org, broonie@...nel.org,
	linux-kernel@...r.kernel.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Bamvor Zhang Jian <bamvor.zhangjian@...aro.org>
Subject: Re: [Y2038] [PATCH v2 2/2] ppdev: add support for compat ioctl

Hi, Arnd

On 12/30/2015 09:51 PM, Arnd Bergmann wrote:
> On Wednesday 30 December 2015 21:24:21 Bamvor Jian Zhang wrote:
>> diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
>> index 31bc7b7..9e98d01 100644
>> --- a/drivers/char/ppdev.c
>> +++ b/drivers/char/ppdev.c
>> @@ -636,7 +636,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>>                 if ((time32[0] < 0) || (time32[1] < 0))
>>                         return -EINVAL;
>>  
>> -               if (copy_to_user(time32, argp, sizeof(time32)))
>> +               if (copy_to_user(argp, time32, sizeof(time32)))
>>                         return -EFAULT;
>>  
>>                 return 0;
>> @@ -648,7 +648,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>>                 if ((time64[0] < 0) || (time64[1] < 0))
>>                         return -EINVAL;
>>  
>> -               if (copy_to_user(time64, argp, sizeof(time64)))
>> +               if (copy_to_user(argp, time64, sizeof(time64)))
>>                         return -EFAULT;
>>  
>>                 return 0;
> 
> This is something that would be caught by running 'make C=1' with 'sparse'
> on your patch. Can you try that to see if you introduce any other warnings?
OK. I do not do it before, there is no extra warning after apply the above
patch.
> I'm guessing it's fine, but it would be nice to confirm. I also send a lot
> of patches without running sparse and checkpatch first, but it's generally
> a good idea.
Got you. I only do the checkpatch in past. I will do sparse and checkpatch
in future.

Regards

Bamvor
> 
> 	Arnd
> _______________________________________________
> Y2038 mailing list
> Y2038@...ts.linaro.org
> https://lists.linaro.org/mailman/listinfo/y2038
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ