From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754556AbcAVRaw (ORCPT ); Fri, 22 Jan 2016 12:30:52 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36336 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754106AbcAVRau (ORCPT ); Fri, 22 Jan 2016 12:30:50 -0500 Date: Fri, 22 Jan 2016 09:30:50 -0800 From: Alexei Starovoitov To: Daniel Sangorrin Cc: keescook@chromium.org, luto@amacapital.net, wad@chromium.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 1/1] seccomp: provide information about the previous syscall Message-ID: <20160122173050.GE9608@ast-mbp.thefacebook.com> References: <1453444200-8604-1-git-send-email-daniel.sangorrin@toshiba.co.jp> <1453444200-8604-2-git-send-email-daniel.sangorrin@toshiba.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453444200-8604-2-git-send-email-daniel.sangorrin@toshiba.co.jp> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2016 at 03:30:00PM +0900, Daniel Sangorrin wrote: > This patch allows applications to restrict the order in which > its system calls may be requested. In order to do that, we > provide seccomp-BPF scripts with information about the > previous system call requested. > > An example use case consists of detecting (and stopping) return > oriented attacks that disturb the normal execution flow of > a user program. > > Signed-off-by: Daniel Sangorrin ... > diff --git a/include/uapi/linux/seccomp.h b/include/uapi/linux/seccomp.h ... > struct seccomp_data { > int nr; > + int prev_nr; > __u32 arch; > __u64 instruction_pointer; > __u64 args[6]; this will break abi for existing seccomp programs. New field has to be at the end.