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]
Date:	Mon, 2 Feb 2015 18:16:36 -0500
From:	Oleg Drokin <green@...uxhacker.ru>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Dan Carpenter <dan.carpenter@...cle.com>,
	devel@...verdev.osuosl.org,
	Dmitry Eremin <dmitry.eremin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/20] staging/lustre: fix comparison between signed and unsigned


On Feb 2, 2015, at 3:51 PM, Greg Kroah-Hartman wrote:
> On Mon, Feb 02, 2015 at 03:25:58PM -0500, Oleg Drokin wrote:
>>> What is this code supposed to be protecting from?  And -1?  That should
>>> never be a return value…
>> 
>> Why is -1 a bad return value if all callsites check for that as an
>> indication of error?
> 
> Because you should use "real" error values, don't make them up with
> random negative numbers that mean nothing.
> 
>> (granted there's only one caller at this point in kernel space:
>> lustre/llite/dir.c::ll_dir_ioctl()
>>                totalsize = hur_len(hur);
>>                OBD_FREE_PTR(hur);
>>                if (totalsize < 0)
>>                        return -E2BIG;
>> )
> 
> Shouldn't you have returned the error that hur_len() passed you?

Ok, I guess that makes quite a bit of sense too.

I'll do an updated patch about that later on then.

Thanks!

Bye,
    Oleg--
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