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: <47905A95.4030500@cateee.net>
Date:	Fri, 18 Jan 2008 08:51:49 +0100
From:	Giacomo Catenazzi <cate@...eee.net>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	David Schwartz <davids@...master.com>,
	Johannes Weiner <hannes@...urebad.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	clameter@....com, penberg@...helsinki.fi
Subject: Re: Why is the kfree() argument const?

Linus Torvalds wrote:
> 
> On Thu, 17 Jan 2008, David Schwartz wrote:
>>> "const" has nothing to do with "logical state".  It has one meaning, and
>>> one meaning only: the compiler should complain if that particular type is
>>> used to do a write access.
>> Right, exactly.
> 
> So why do you complain? 
> 
> kfree() literally doesn't write to the object.
> 
>> You are the only one who has suggested it has anything to do with changes
>> through other pointers or in other ways. So you are arguing against only
>> yourself here.
> 
> No, I'm saying that "const" has absolutely *zero* meaning on writes to an 
> object through _other_ pointers (or direct access) to the object.

Hints: "restrict" is the C99 keyword for such requirement (or better
"const restrict")

BTW I think C use non const free as a BIG warning about not to be
to "smart" on optimization.

ciao
	cate
--
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