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: <Pine.LNX.4.61.0612081134360.12227@yvahk01.tjqt.qr>
Date:	Fri, 8 Dec 2006 11:38:13 +0100 (MET)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
To:	Josef Sipek <jsipek@....cs.sunysb.edu>
cc:	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>,
	linux-kernel@...r.kernel.org, torvalds@...l.org, akpm@...l.org,
	hch@...radead.org, viro@....linux.org.uk,
	linux-fsdevel@...r.kernel.org, mhalcrow@...ibm.com
Subject: Re: [PATCH 26/35] Unionfs: Privileged operations workqueue


On Dec 7 2006 21:17, Josef Sipek wrote:
>> >> > >+void __unionfs_mknod(void *data)
>> >> > >+{
>> >> > >+	struct sioq_args *args = data;
>> >> > >+	struct mknod_args *m = &args->mknod;

...
||||| vfs_mknod(m->parent, m->dentry, m->mode, m->dev);

>> >If I make the *args = data line const, then gcc (4.1) yells about modifying
>> >a const variable 3 lines down..
>> >
>> >args->err = vfs_mknod(m->parent, m->dentry, m->mode, m->dev);
>> >
>> >Sure, I could cast, but that seems like adding cruft for no good reason.
>> 
>> No I despise casts more than missing consts. Why would gcc throw a warning?
>> Let's take this super simple program
>
>No, this program doesn't tickle the problem.. Try to compile this one:

The members of m (i.e. m->*) are not modified as for as __unionfs_mknod goes.
vfs_mknod may only modify the members of m->parent (i.e. m->parent->*)

>
><<<
>struct mknod_args {
>	int mode;
>	int dev;
>};
>
>void  __mknod(const void *data)
>{
>	const struct mknod_args *args = data;
>	args->mode = 0;
>}
>
>int main(void) {
>	const struct mknod_args *m;
>	__mknod(m);
>	return 0;
>}
>>>>
>
>$ gcc -Wall -c test.c
>test.c: In function âmknodâtest.c:10: error: assignment of read-only location
>
>
>Josef "Jeff" Sipek.
>
>-- 
>Reality is merely an illusion, albeit a very persistent one.
>		- Albert Einstein
>

	-`J'
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ