Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966899AbdIZBAn (ORCPT ); Mon, 25 Sep 2017 21:00:43 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51858 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934514AbdIZBAm (ORCPT ); Mon, 25 Sep 2017 21:00:42 -0400 Date: Tue, 26 Sep 2017 02:00:36 +0100 From: Al Viro To: Kyle Huey Cc: open list , "Robert O'Callahan" , Linus Torvalds Subject: [git pull] vfs.git regression fix Re: Regression related to ipc shmctl compat Message-ID: <20170926010036.GX32076@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1649 Lines: 48 On Mon, Sep 25, 2017 at 03:18:29PM -0700, Kyle Huey wrote: > Beginning with 553f770ef71b, the following program fails when compiled > for 32 bit and executed on a 64 bit kernel and succeeds when compiled > for and executed on a 64 bit. It continues to fail even after > 58aff0af7573. When compiled as 32 bit, an shmctl call fails with > EBADR (see the XXX comment). Egads... static int put_compat_shm_info(struct shm_info *ip, struct compat_shm_info __user *uip) { struct compat_shm_info info; memset(&info, 0, sizeof(info)); info.used_ids = ip->used_ids; info.shm_tot = ip->shm_tot; info.shm_rss = ip->shm_rss; info.shm_swp = ip->shm_swp; info.swap_attempts = ip->swap_attempts; info.swap_successes = ip->swap_successes; return copy_to_user(up, &info, sizeof(info)); ^^ This. I really wish gcc warned about conversions from pointer to function into void *... Linus, could you pull that? The following changes since commit 58aff0af757356065f33290d96a9cd46dfbcae88: ipc/shm: Fix order of parameters when calling copy_compat_shmid_to_user (2017-09-20 23:27:48 -0400) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-linus for you to fetch changes up to b776e4b1a990045a7c70798f1f353c3160c26594: fix a typo in put_compat_shm_info() (2017-09-25 20:41:46 -0400) ---------------------------------------------------------------- Al Viro (1): fix a typo in put_compat_shm_info() ipc/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)