Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbdIAL5J (ORCPT ); Fri, 1 Sep 2017 07:57:09 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:22397 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbdIAL5H (ORCPT ); Fri, 1 Sep 2017 07:57:07 -0400 X-Greylist: delayed 2117 seconds by postgrey-1.27 at vger.kernel.org; Fri, 01 Sep 2017 07:57:05 EDT Subject: [RFC PATCH 2/2] autofs: sent 32-bit sized packet for 32-bit process From: Stanislav Kinsburskiy To: raven@themaw.net Cc: autofs@vger.kernel.org, linux-kernel@vger.kernel.org, devel@openvz.org, ldv@altlinux.org Date: Fri, 01 Sep 2017 15:21:49 +0400 Message-ID: <20170901112149.2669.85432.stgit@localhost.localdomain> In-Reply-To: <20170901110906.2669.1577.stgit@localhost.localdomain> References: <20170901110906.2669.1577.stgit@localhost.localdomain> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 933 Lines: 26 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 Signed-off-by: Stanislav Kinsburskiy --- 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;