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:	Fri, 12 Sep 2014 16:16:15 +0200
From:	Richard Weinberger <richard.weinberger@...il.com>
To:	Rob Jones <rob.jones@...ethink.co.uk>
Cc:	Al Viro <viro@...iv.linux.org.uk>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...ethink.co.uk
Subject: Re: [PATCH] fs: replace int param with size_t for seq_open_private()

On Thu, Sep 11, 2014 at 6:25 PM, Rob Jones <rob.jones@...ethink.co.uk> wrote:
>
>
> On 01/09/14 16:36, Al Viro wrote:
>>
>> On Mon, Sep 01, 2014 at 02:17:08PM +0100, Rob Jones wrote:
>>
>>>   void *__seq_open_private(struct file *f, const struct seq_operations
>>> *ops,
>>> -               int psize)
>>> +               size_t psize)
>>
>>
>> <sarcasm>
>> It is a horrible limitation to impose, indeed.  Why, a lousy
>> 2 gigabytes per line in procfs file - that's intolerable...
>> </sarcasm>
>>
>>
>
> OK, I know this is a trivial patch but I've gone away and thought about
> it and done some reading to see what the rest of the world thinks about
> using size_t vs unsigned int (signed int is an abomination in this
> context regardless).
>
> I think Al's sarcasm is misplaced.
>
> The correct type to use here *is* size_t. It's about consistency and,
> more importantly, it's about not making assumptions about the hardware
> architecture. It's included in the language for very good reasons and
> it seems to me to be risky to ignore those reasons.

Please don't forget to patch all for loops to use size_t instead of int too.

-- 
Thanks,
//richard
--
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