From patchwork Wed Nov 26 04:49:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 41518 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65BE125E18 for ; Wed, 26 Nov 2014 04:51:10 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf1450584wid.7 for ; Tue, 25 Nov 2014 20:51:09 -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=byKSG3REE+s6uJjasvoV6NuE5+S/DX7qQ0dZS3Vca/oVB5d3ZCrQP0SkjOpM46wEd/ WtEEJKXYyWe0grQ510ImyDT6sCwwF1Ib2B0WYmRg6+QYgegXg9IdS/IMs+nDCnQxzpWi sgTGIV9IrJ3qBFRL/ctDtom+xAqpyLeTBoZW7eFeDHUUjBk0ShRz/BnHozEepN+kBqWc 8j/+Zzrc3EtHjDfVcIBP3oiRzvZYEcRDG2TuEd+8wmDMUo8atY3olCkTGr/HbMfcC75x SWY9fvtBtFCRuDVN02qsnOCle9f+8XZcm2pNLmpcrCgTM7uLgQi2EiJIcTC7U7Ag6j6h 4CTw== X-Gm-Message-State: ALoCoQkWDRGN+apjTxxnhTuQC394kgtVBXsO7XfLue+l0Qps82Lox/W1uR+AG6HTdm8yCZPNcb8i X-Received: by 10.181.12.37 with SMTP id en5mr6499875wid.6.1416977469693; Tue, 25 Nov 2014 20:51:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.165 with SMTP id x5ls267357lal.34.gmail; Tue, 25 Nov 2014 20:51:09 -0800 (PST) X-Received: by 10.112.168.97 with SMTP id zv1mr32273152lbb.6.1416977469103; Tue, 25 Nov 2014 20:51:09 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id f8si3170915lab.102.2014.11.25.20.51.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 20:51:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id gf13so1839555lab.13 for ; Tue, 25 Nov 2014 20:51:09 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr31198757lbr.74.1416977469003; Tue, 25 Nov 2014 20:51:09 -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 ew9csp567484lbc; Tue, 25 Nov 2014 20:51:08 -0800 (PST) X-Received: by 10.66.66.76 with SMTP id d12mr49264095pat.111.1416977467356; Tue, 25 Nov 2014 20:51:07 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ez2si4913993pab.183.2014.11.25.20.51.05 for ; Tue, 25 Nov 2014 20:51:07 -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 S1752478AbaKZEvB (ORCPT + 26 others); Tue, 25 Nov 2014 23:51:01 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:51473 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbaKZEu7 (ORCPT ); Tue, 25 Nov 2014 23:50:59 -0500 Received: by mail-pd0-f171.google.com with SMTP id y13so2018678pdi.30 for ; Tue, 25 Nov 2014 20:50:59 -0800 (PST) X-Received: by 10.69.0.138 with SMTP id ay10mr48827258pbd.110.1416977458976; Tue, 25 Nov 2014 20:50:58 -0800 (PST) Received: from localhost.localdomain (KD182249086035.au-net.ne.jp. [182.249.86.35]) by mx.google.com with ESMTPSA id yp8sm2962059pab.48.2014.11.25.20.50.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Nov 2014 20:50:57 -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 v9 5/6] arm64: add SIGSYS siginfo for compat task Date: Wed, 26 Nov 2014 13:49:50 +0900 Message-Id: <1416977391-24231-6-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416977391-24231-1-git-send-email-takahiro.akashi@linaro.org> References: <1416977391-24231-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.54 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);