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: <4B1AF856.6040305@gmail.com>
Date:	Sun, 06 Dec 2009 01:18:30 +0100
From:	Emese Revfy <re.emese@...il.com>
To:	Matthew Wilcox <matthew@....cx>
CC:	torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/31] Constify struct address_space_operations for	2.6.32
 v1

Matthew Wilcox wrote:
> On Sat, Dec 05, 2009 at 01:36:56AM +0100, Emese Revfy wrote:
>> Matthew Wilcox wrote:
>>> On Fri, Dec 04, 2009 at 11:08:09PM +0100, Emese Revfy wrote:
>>>> -	int (*writepage)(struct page *page, struct writeback_control *wbc);
>>>> +	int (* const writepage)(struct page *page, struct writeback_control *wbc);
>>> Umm.  What effect does this have?
>>> What changes as a result of this patch?
>> My idea was that since all variables of this type are const, we might
>> as well have the compiler enforce it for the future if you think that
>> these fields should not be writable at all.
> 
> The compiler does already enforce it.  We do it like this:
> 
> struct address_space {
>         const struct address_space_operations *a_ops;   /* methods */
> }

This only ensures that the address_space_operations structure cannot be
written through a_ops, but the address_space_operations structure itself
can still be writable. My patch fixes the latter issue.
--
Emese

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