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: 41663 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 069E6244C2 for ; Fri, 28 Nov 2014 05:27:58 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf3676608lam.10 for ; Thu, 27 Nov 2014 21:27:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=LVjXtCMb9EWoGD7yDMsC7dymOpZMuocqd6TSfL8eFJU=; b=boMqhq9jjLiOp4Bsl5AheJ+DqsnyFod7Oq9Vy5ZXWaHhTYNEQ6mqBcjfehueB2ib9F GjojAWXNTuRIiC3ML8uiNDDxMHJMP8sspMzN1bEEKeVAC3rmV9WKEoghtQHYN9RqZsiR b/cheBw5B/UGr0AbjNCOAV0fsbmPhO2tS/GlSPYUzT9U1+8tALosEBEeehC4Vl6Gmezz yq0K8zIUMV+8r7EUlT+MHJ4+V4vQ6CuSzUhaq43f7av+u8P9TlAh/OsKF1NVEFKOmRIk b2u1/m2OF1seN2O14Tye0NBcR6XGAAgvwJH5G6cU4wreCFR05vp0/WYmor4Z6IAt117I xKJA== X-Gm-Message-State: ALoCoQkgq9LxYw+GzsG5IZpOXFe3z9BOJntsIdCdL8ycsELEsVsnBU4I6PB8tm7CeBo1fj44tq2b X-Received: by 10.194.133.39 with SMTP id oz7mr3324150wjb.3.1417152476892; Thu, 27 Nov 2014 21:27:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.41 with SMTP id q9ls732062lag.67.gmail; Thu, 27 Nov 2014 21:27:56 -0800 (PST) X-Received: by 10.152.36.4 with SMTP id m4mr38954739laj.95.1417152476473; Thu, 27 Nov 2014 21:27:56 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id um10si8893752lbb.117.2014.11.27.21.27.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Nov 2014 21:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so4910894lab.8 for ; Thu, 27 Nov 2014 21:27:56 -0800 (PST) X-Received: by 10.152.8.170 with SMTP id s10mr41947416laa.56.1417152476365; Thu, 27 Nov 2014 21:27:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp35202lbc; Thu, 27 Nov 2014 21:27:55 -0800 (PST) X-Received: by 10.66.165.200 with SMTP id za8mr70361037pab.156.1417152474647; Thu, 27 Nov 2014 21:27:54 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hj7si14425239pac.180.2014.11.27.21.27.53 for ; Thu, 27 Nov 2014 21:27:54 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751468AbaK1F1s (ORCPT + 26 others); Fri, 28 Nov 2014 00:27:48 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:33717 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbaK1F1p (ORCPT ); Fri, 28 Nov 2014 00:27:45 -0500 Received: by mail-pd0-f170.google.com with SMTP id fp1so6009597pdb.15 for ; Thu, 27 Nov 2014 21:27:45 -0800 (PST) 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 Cc: dsaxena@linaro.org, arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, AKASHI Takahiro 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);