From patchwork Fri Nov 28 05:26:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 5401611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63DD59F443 for ; Fri, 28 Nov 2014 05:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FAF220123 for ; Fri, 28 Nov 2014 05:31:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A236D2012D for ; Fri, 28 Nov 2014 05:31:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XuE7I-0007Kr-M2; Fri, 28 Nov 2014 05:29:16 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XuE6D-0006ar-7K for linux-arm-kernel@lists.infradead.org; Fri, 28 Nov 2014 05:28:10 +0000 Received: by mail-pd0-f171.google.com with SMTP id y13so6033333pdi.30 for ; Thu, 27 Nov 2014 21:27:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XVwK7AdC1T/Lru8R96aGBvXxdJqDWNU/NFIan7HPKz0=; b=leqAFaqoqDXOdLHWyX3WjTXT4gp3AbEHopzFOf6339Wj4yG7GqtJvGEzarBc2Oe/jk H3YXAv69nZwZy9S4Qec8aT94UDZ0LVC3efezfCYOlI4rLl/N1NmLD3sm7RZDsxy0Ylf/ NyePo9BzYeRCTaJz74SlnBGzEUJGY+qTKlG4o0EnjgYkDvd6olOT+0tvFa3ANXAJ9X1o t406aT4d9K9m/VkYWqy3TBEJVmwpmlKhLxmbwRVAYX1+AdydPlvZ9SBpyOQdwKxR1yUe SDf4Mcc+D7PVsR8QWbYyZDZbjvk04gUYn6yAcB4l2d8lu6x1dJxNGFevnnRmKTvQlbbK vC6w== X-Gm-Message-State: ALoCoQmgNmbV2u7cjHqsi5NjWhEOppMB06DWX2H2gxrVQ03P4WFE+LkIqUfqFKSahnwbpn6Fn6g1 X-Received: by 10.66.138.72 with SMTP id qo8mr9196565pab.84.1417152465531; Thu, 27 Nov 2014 21:27:45 -0800 (PST) Received: from localhost.localdomain (KD182249096114.au-net.ne.jp. [182.249.96.114]) by mx.google.com with ESMTPSA id kp2sm8661866pdb.30.2014.11.27.21.27.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Nov 2014 21:27:44 -0800 (PST) From: AKASHI Takahiro To: keescook@chromium.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v10 5/6] arm64: add SIGSYS siginfo for compat task Date: Fri, 28 Nov 2014 14:26:38 +0900 Message-Id: <1417152399-32717-6-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417152399-32717-1-git-send-email-takahiro.akashi@linaro.org> References: <1417152399-32717-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141127_212809_311088_3853A11B X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, arndb@arndb.de, linux-kernel@vger.kernel.org, AKASHI Takahiro , dsaxena@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SIGSYS is primarily used in secure computing to notify tracer of syscall events. This patch allows signal handler on compat task to get correct information with SA_SIGINFO specified when this signal is delivered. Reviewed-by: Kees Cook Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/compat.h | 7 +++++++ arch/arm64/kernel/signal32.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 56de5aa..3fb053f 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -205,6 +205,13 @@ typedef struct compat_siginfo { compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */ int _fd; } _sigpoll; + + /* SIGSYS */ + struct { + compat_uptr_t _call_addr; /* calling user insn */ + int _syscall; /* triggering system call number */ + compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */ + } _sigsys; } _sifields; } compat_siginfo_t; diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 1b9ad02..5a1ba6e 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -186,6 +186,12 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) err |= __put_user(from->si_uid, &to->si_uid); err |= __put_user((compat_uptr_t)(unsigned long)from->si_ptr, &to->si_ptr); break; + case __SI_SYS: + err |= __put_user((compat_uptr_t)(unsigned long) + from->si_call_addr, &to->si_call_addr); + err |= __put_user(from->si_syscall, &to->si_syscall); + err |= __put_user(from->si_arch, &to->si_arch); + break; default: /* this is just in case for now ... */ err |= __put_user(from->si_pid, &to->si_pid); err |= __put_user(from->si_uid, &to->si_uid);