All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] autofs4: fix 32-bit userspace vs 64-bit kernel communications
@ 2008-06-11  9:54 Pavel Emelyanov
  2008-06-11 12:32 ` Ian Kent
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Emelyanov @ 2008-06-11  9:54 UTC (permalink / raw)
  To: Ian Kent
  Cc: autofs mailing list, Linux Kernel Mailing List,
	Konstantin Khlebnikov

From: Konstantin Khlebnikov <khlebnikov@openvz.org>

The struct autofs_v5_packet has only one difference between
32-bit and 64-bit versions - on 64-bit gcc aligns its size and
it is 4 bytes larger that it is on 32-bit kernel. This confuses
32-bit user-space daemon, when talking to 64-bit kernel.

This is very critical for containerized setups, when containers
with <different>-bit tolls are used.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 1e4a539..9855b6e 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -132,6 +132,14 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 		struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
 
 		pktsz = sizeof(*packet);
+#if defined(CONFIG_X86_64) && defined(CONFIG_IA32_EMULATION)
+		/*
+		 * On x86_64 autofs_v5_packet struct is padded with 4 bytes
+		 * which breaks 32-bit autofs daemon.
+		 */
+		if (test_thread_flag(TIF_IA32))
+			pktsz -= 4;
+#endif
 
 		packet->wait_queue_token = wq->wait_queue_token;
 		packet->len = wq->len;

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

end of thread, other threads:[~2008-06-12  2:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11  9:54 [PATCH] autofs4: fix 32-bit userspace vs 64-bit kernel communications Pavel Emelyanov
2008-06-11 12:32 ` Ian Kent
2008-06-11 12:47   ` Pavel Emelyanov
2008-06-11 13:08     ` Ian Kent
2008-06-11 13:15     ` Ian Kent
2008-06-11 13:25       ` Pavel Emelyanov
2008-06-11 13:40         ` Ian Kent
2008-06-11 14:29       ` Mikael Pettersson
2008-06-12  2:52         ` Ian Kent

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.