Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp221029imu; Wed, 21 Nov 2018 18:34:41 -0800 (PST) X-Google-Smtp-Source: AJdET5fg0EPDtyJDfnsvJxeMvTdABeXXVFXQ+55MHlMy6UK/GxwUj9yQcm1VAIEhR6v2mN45Rg5s X-Received: by 2002:a62:647:: with SMTP id 68-v6mr9886350pfg.42.1542854081447; Wed, 21 Nov 2018 18:34:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542854081; cv=none; d=google.com; s=arc-20160816; b=tmJv51XBQMQaHTO+fl89LodiLiaNisSNvkSBljMN6wkm4xvE27IVM3lfUj9qwqZmIL Jf+Yc5BbJ35pahrCy/wNHwHesZKiInK5vvEEiM2KR52X7w9Z6jO7c35t/dgZ/4r+4FyY kJIggNgNcHhB4Xw4xjUSs97RR2uJsB2YuEnm/EsSn5a4sIu3efMJr0UNWgqCQrAJByrh jrdvT2iFrVtoreO+gabKvSCLhvJ0+wkBxutGWbfCyFeI0wqSwRdpgVomV61SuOoykrab Wy+CRYdAmF/nw2pWYFNQHKei2NiowD8nVeU8hQe6v3hgPp4iJjWmsvUe2e50sAypFZrW wQSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=apinzBpQGeSX7D1NFQpHNJfmin1YLq42w1BVMCUfTyU=; b=EFbG0SmoxRiZ+4Kq2sC342qhkW+eFT63VlR5j+QCefl6SxtJOpY7bBt5H3Cr/5k8r5 0e9Jc3IDOZgcF//1FJtx5nT8Jx2LeGx72cMnm89J8IGk2TSLItGef+s8Wb7g99VXoTQr rxs4rB7cStyRxHZZ7aIaA3rusnrosNTWtsLu/vi1xnTIL7KPSa2G1XxhxR2JHqLHQyyP PpmPbxn1j7l83XdPMpzhY9ofoVwOldYCAu2oXdOkRU8hsPZPTaIeL/s5rma54XSfPl3A Kg9zlgZAQLAHU3ZWqpCdDFKHPRzwJe6q3qXIKop7inUZN9NljO3skCOQK4o2JeldVUf6 I+4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si14945742pld.229.2018.11.21.18.34.24; Wed, 21 Nov 2018 18:34:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731109AbeKVFuO (ORCPT + 99 others); Thu, 22 Nov 2018 00:50:14 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:37842 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729009AbeKVFuO (ORCPT ); Thu, 22 Nov 2018 00:50:14 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 8EC4972CC66; Wed, 21 Nov 2018 22:14:39 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 811D77CD20A; Wed, 21 Nov 2018 22:14:39 +0300 (MSK) Date: Wed, 21 Nov 2018 22:14:39 +0300 From: "Dmitry V. Levin" To: Paul Burton Cc: Elvira Khabirova , Ralf Baechle , James Hogan , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH] mips: fix mips_get_syscall_arg o32 check Message-ID: <20181121191438.GB10301@altlinux.org> References: <20181107042751.3b519062@akathisia> <20181120001128.GA11300@altlinux.org> <20181121004422.GA29053@altlinux.org> <20181121184004.jro532jopnbmru2m@pburton-laptop> <20181121190009.GA10301@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121190009.GA10301@altlinux.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When checking for TIF_32BIT_REGS flag, mips_get_syscall_arg() should use the task specified as its argument instead of the current task. This potentially affects all syscall_get_arguments() users who specify tasks different from the current. Fixes: c0ff3c53d4f99 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.") Signed-off-by: Dmitry V. Levin --- arch/mips/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index 0170602a1e4e..6cf8ffb5367e 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h @@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, #ifdef CONFIG_64BIT case 4: case 5: case 6: case 7: #ifdef CONFIG_MIPS32_O32 - if (test_thread_flag(TIF_32BIT_REGS)) + if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) return get_user(*arg, (int *)usp + n); else #endif -- ldv