Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbdGQKRk (ORCPT ); Mon, 17 Jul 2017 06:17:40 -0400 Received: from ozlabs.org ([103.22.144.67]:56843 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbdGQKRj (ORCPT ); Mon, 17 Jul 2017 06:17:39 -0400 From: Michael Ellerman To: James Morse , linux-kernel@vger.kernel.org Cc: Zhou Chengming , Andrey Vagin , Roland McGrath , Oleg Nesterov , Yury Norov , James Morse , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers In-Reply-To: <20170629162637.10676-1-james.morse@arm.com> References: <20170629162637.10676-1-james.morse@arm.com> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Mon, 17 Jul 2017 20:17:35 +1000 Message-ID: <87k2371i68.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 896 Lines: 23 James Morse writes: > compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK, > instead using those in ptrace_request(). The compat variant should > read a compat_sigset_t from userspace instead of ptrace_request()s > sigset_t. > > While compat_sigset_t is the same size as sigset_t, it is defined as > 2xu32, instead of a single u64. On a big-endian CPU this means that > compat_sigset_t is passed to user-space using middle-endianness, > where the least-significant u32 is written most significant byte > first. > > If ptrace_request()s code is used userspace will read the most > significant u32 where it expected the least significant. But that's what the code has done since 2013. So won't changing this break userspace that has been written to work around that bug? Or do we think nothing actually uses it in the wild and we can get away with it? cheers