From patchwork Thu Aug 21 08:56:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 35730 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C33EF20540 for ; Thu, 21 Aug 2014 08:58:26 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id v1sf30106111yhn.8 for ; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) 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=Zo1j0v1cDxsht/kgXp21bhmSacY+85P1krgqKfPVWts=; b=lpaqXECag84hecy7adRRsKB7IbBsjiUMS/xICltdNASTUO5lk99lugFGDGkNEHSiKl +ViIpIr55hAGon83peivAu3eKOHgjHy9Kmm0ux97sM7crd9PP27d55wS3Zys6tzz0Dhd MIGgVgk3VMqFxsbz4qPnk2HmFMVi49OEFgObAw5irNKHQR0dAuN/bGy79DcQOtuF8DKF FA9/0m45aAcFziPm5aEqtAKc3lkdt77Ky8Z7TYQxeCWYfUV+2QnDdXncrbkZqwLLbWj6 LFkgVlb+LCLtKO287KNu2ky5WHfFbsnqABrmIToh5ulYya0ZT/GEASCS5XJ2jv67JOWg Cx/Q== X-Gm-Message-State: ALoCoQnsjmgqMS/MPWFJcFTWqXalCbv7nhcrD/vftHVbYoti72KfW5PwCHTyKOg30BraYFIAhqX+ X-Received: by 10.224.29.1 with SMTP id o1mr28767784qac.0.1408611506582; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.47 with SMTP id w44ls602617qgw.95.gmail; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) X-Received: by 10.52.1.39 with SMTP id 7mr2949914vdj.17.1408611506511; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id cj4si12121849vdd.77.2014.08.21.01.58.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 01:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so10428021vcb.17 for ; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) X-Received: by 10.220.182.73 with SMTP id cb9mr41454027vcb.9.1408611506433; Thu, 21 Aug 2014 01:58:26 -0700 (PDT) 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.221.45.67 with SMTP id uj3csp118519vcb; Thu, 21 Aug 2014 01:58:25 -0700 (PDT) X-Received: by 10.68.139.74 with SMTP id qw10mr59506525pbb.100.1408611505558; Thu, 21 Aug 2014 01:58:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo5si35581275pac.90.2014.08.21.01.58.24 for ; Thu, 21 Aug 2014 01:58:25 -0700 (PDT) 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 S1754147AbaHUI6P (ORCPT + 26 others); Thu, 21 Aug 2014 04:58:15 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:42272 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918AbaHUI6M (ORCPT ); Thu, 21 Aug 2014 04:58:12 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so13211843pde.18 for ; Thu, 21 Aug 2014 01:58:11 -0700 (PDT) X-Received: by 10.66.150.5 with SMTP id ue5mr58228802pab.129.1408611491813; Thu, 21 Aug 2014 01:58:11 -0700 (PDT) Received: from localhost.localdomain (KD182249099030.au-net.ne.jp. [182.249.99.30]) by mx.google.com with ESMTPSA id q5sm37734708pdf.70.2014.08.21.01.58.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Aug 2014 01:58:10 -0700 (PDT) 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 v6 5/6] arm64: add SIGSYS siginfo for compat task Date: Thu, 21 Aug 2014 17:56:44 +0900 Message-Id: <1408611405-8943-6-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408611405-8943-1-git-send-email-takahiro.akashi@linaro.org> References: <1408611405-8943-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.220.172 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. This patch allows signal handler on compat task to get correct information with SA_SYSINFO specified when this signal is delivered. Signed-off-by: AKASHI Takahiro Reviewed-by: Kees Cook --- arch/arm64/include/asm/compat.h | 7 +++++++ arch/arm64/kernel/signal32.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 253e33b..c877915 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 */ + unsigned int _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..aa550d6 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -186,6 +186,14 @@ 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; +#ifdef __ARCH_SIGSYS + 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; +#endif 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);