27 May 2010 05:31
Q. 'const'antify the members of a structure
Hello all,
The grsec/pax patches make member of struct brabra_operation 'const.'
I don't understand why they need these 'const'. They modifies some of
structures, but other structures.
What do they want to protect from what?
From my point of view, the keyword 'const' is essentially a feature of C
language and it never modifes the behaviour of software. It just
prohibits the assignment (or modification) to a variable which is
expected not to be modified.
In other word, it is a feature for programmers and doesn't enhance the
security level. Actually programmers can bypass 'const' easily by
indirect assignment.
Also the grsec/pax patches modifies some assignments to the member
of struct brabra_operation in mainline kernel, but they don't make the
confirmation fot that. For example, they replaced these assignments by
declaring a structure statically.
(I know they don't make member of file_operations 'const', so this is
exmaple is unrelated to the above.)
- /* inherit and extend fuse_dev_operations */
- cuse_channel_fops = fuse_dev_operations;
- cuse_channel_fops.owner = THIS_MODULE;
- cuse_channel_fops.open = cuse_channel_open;
- cuse_channel_fops.release = cuse_channel_release;
+static const struct file_operations cuse_channel_fops = {
(Continue reading)
RSS Feed