All of lore.kernel.org
 help / color / mirror / Atom feed
* size-differences of long(userspace) / long(kernel)
@ 2005-02-14 15:56 Michael Tautschnig
  2005-02-14 16:13 ` David S. Miller
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Michael Tautschnig @ 2005-02-14 15:56 UTC (permalink / raw)
  To: sparclinux

Hello!

Is there any generic way in situations, where (pointers 
to) structs are transferred from user- to kernelspace and vice versa? 
Any struct containing a long int or a pointer will have a different 
size in kernel space! This usually happens when doing ioctls ...

I'm not sure, whether it causes any troubles, but, e.g., ifreq contains 
another struct (ifmap) that in turn contains long ints . Thus the size of 
ifreq is 32 byte in userspace and 40 byte in kernelspace. If an 
application reserves sizeof(ifreq) bytes, then lets the kernel initialize 
the struct, which in turn copies it back to userspace - and thus might 
overwrite 8bytes that were not reserved for that struct ... Oops :-)

Any thoughts?

Michael


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-02-18 16:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-14 15:56 size-differences of long(userspace) / long(kernel) Michael Tautschnig
2005-02-14 16:13 ` David S. Miller
2005-02-14 16:32 ` Jurzitza, Dieter
2005-02-14 16:34 ` Michael Tautschnig
2005-02-14 16:43 ` David S. Miller
2005-02-15  3:40 ` Ben Collins
2005-02-18  8:19 ` Jurzitza, Dieter
2005-02-18 16:22 ` Jurzitza, Dieter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.