Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Sandeen wrote:
>but Al felt that it was probably better to create an EIO-returner for each 
>actual op signature.  Since so few ops share a signature, I just went ahead 
>& created an EIO function for each individual file & inode op that returns
>a value.

Hmm, the problem with this is it bloats bad_inode.o with lots of empty
functions that return -EIO.  Even though we're not interested in the
parameters, GCC doesn't know this, and doesn't fold the functions into only
the couple of definitions that return different types.

Text size of original bad_inode.o:

Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         0000006c  00000000  00000000  00000034  2**2

== 108 bytes

Size with patch applied:

Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         0000016b  00000000  00000000  00000034  2**2 patch
applied:

== 363 bytes, or over three times larger!

>I originally had coded up the fix by creating a return_EIO_<TYPE> macro 
>for each return type,

This adds two extra functions (return for ssize_t and long), which gives an
increase in size of only 12 bytes:

Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000078  00000000  00000000  00000034  2**2

== 120 bytes.

Isn't this better?

Thanks

Phillip

-- 
View this message in context: http://www.nabble.com/-UPDATED-PATCH--fix-memory-corruption-from-misinterpreted-bad_inode_ops-return-values-tf2916716.html#a8178968
Sent from the linux-fsdevel mailing list archive at Nabble.com.

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux