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:	Mon, 20 Aug 2012 09:09:42 +0900
From:	Namjae Jeon <linkinjeon@...il.com>
To:	Fengguang Wu <fengguang.wu@...el.com>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit

2012/8/19, Fengguang Wu <fengguang.wu@...el.com>:
> On Sat, Aug 18, 2012 at 05:49:21AM -0400, Namjae Jeon wrote:
>> unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long
>> dirty)
>>
>> Above function return type is unsigned long, but return value is
>> kept in "u64 bdi_dirty".
>> It can return incorrect value by type casting.
>
> I don't see how the cast can return wrong value.
> The u64 is necessary for the intermediate calculations.
>
> Thanks,
> Fengguang
Hi Wu.
I understand.
Thanks for your reply.
>
>> Signed-off-by: Namjae Jeon <linkinjeon@...il.com>
>> ---
>>  mm/page-writeback.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
>> index 49133b6..73a7a06 100644
>> --- a/mm/page-writeback.c
>> +++ b/mm/page-writeback.c
>> @@ -546,7 +546,7 @@ static unsigned long hard_dirty_limit(unsigned long
>> thresh)
>>   */
>>  unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long
>> dirty)
>>  {
>> -	u64 bdi_dirty;
>> +	unsigned long bdi_dirty;
>>  	long numerator, denominator;
>>
>>  	/*
>> --
>> 1.7.9.5
>
--
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