From: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
To: raven@themaw.net
Cc: autofs@vger.kernel.org, linux-kernel@vger.kernel.org,
devel@openvz.org, ldv@altlinux.org
Subject: [RFC PATCH 2/2] autofs: sent 32-bit sized packet for 32-bit process
Date: Fri, 01 Sep 2017 15:21:49 +0400 [thread overview]
Message-ID: <20170901112149.2669.85432.stgit@localhost.localdomain> (raw)
In-Reply-To: <20170901110906.2669.1577.stgit@localhost.localdomain>
The structure autofs_v5_packet (except name) is not aligned by 8 bytes, which
leads to different sizes in 32 and 64-bit architectures.
Let's form 32-bit compatible packet when daemon has 32-bit addressation.
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
fs/autofs4/waitq.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 24a58bf..1f9b7d8 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -151,6 +151,11 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
struct user_namespace *user_ns = sbi->pipe->f_cred->user_ns;
+#ifdef CONFIG_COMPAT
+ if (sbi->is32bit)
+ pktsz = offsetofend(struct autofs_v5_packet, name);
+ else
+#endif
pktsz = sizeof(*packet);
packet->wait_queue_token = wq->wait_queue_token;
next prev parent reply other threads:[~2017-09-01 11:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 11:21 [RFC PATCH 0/2] autofs: fix autofs_v5_packet dlivery in compat mode Stanislav Kinsburskiy
2017-09-01 11:21 ` [RFC PATCH 1/2] autofs: set compat flag on sbi when daemon uses 32bit addressation Stanislav Kinsburskiy
2017-09-14 0:38 ` Ian Kent
2017-09-14 9:24 ` Stanislav Kinsburskiy
2017-09-14 11:29 ` Ian Kent
2017-09-14 11:39 ` Stanislav Kinsburskiy
2017-09-14 11:45 ` Ian Kent
2017-09-14 11:51 ` Stanislav Kinsburskiy
2017-09-01 11:21 ` Stanislav Kinsburskiy [this message]
2017-09-14 0:32 ` [RFC PATCH 0/2] autofs: fix autofs_v5_packet dlivery in compat mode Ian Kent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170901112149.2669.85432.stgit@localhost.localdomain \
--to=skinsbursky@virtuozzo.com \
--cc=autofs@vger.kernel.org \
--cc=devel@openvz.org \
--cc=ldv@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raven@themaw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).