Add sys_unveil()

This commit is contained in:
asou 2019-10-23 02:35:05 +00:00
parent ee5ff3b283
commit 6300169e12
4 changed files with 52 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.20 2019/10/02 17:19:29 rsadowski Exp $
# $OpenBSD: Makefile,v 1.21 2019/10/23 02:35:05 asou Exp $
USE_WXNEEDED = Yes
@ -9,7 +9,7 @@ CATEGORIES = devel
V = 3.10.1
PV = 20160331
REVISION = 13
REVISION = 14
DISTNAME = valgrind-${V}
EXTRACT_SUFX = .tar.bz2

View File

@ -0,0 +1,10 @@
--- coregrind/m_syswrap/priv_syswrap-openbsd.h.orig
+++ coregrind/m_syswrap/priv_syswrap-openbsd.h
@@ -144,6 +144,7 @@
DECL_TEMPLATE(openbsd, sys_pledge);
DECL_TEMPLATE(openbsd, sys_ppoll);
DECL_TEMPLATE(openbsd, sys_pselect);
+DECL_TEMPLATE(openbsd, sys_unveil);
DECL_TEMPLATE(openbsd, sys_sigsuspend);
DECL_TEMPLATE(openbsd, sys_gettimeofday);
DECL_TEMPLATE(openbsd, sys_getrusage);

View File

@ -0,0 +1,30 @@
--- coregrind/m_syswrap/syswrap-openbsd.c.orig
+++ coregrind/m_syswrap/syswrap-openbsd.c
@@ -575,6 +579,17 @@
// XXXTBD
}
+PRE(sys_unveil)
+{
+ PRINT("sys_unveil ( %#lx(%s), %#lx(%s) )",
+ ARG1,(char *)ARG1,ARG2,(char*)ARG2);
+ PRE_REG_READ2(long, "unveil", const char *, path, const char *, permissions);
+ if (ARG1 != (UWord)NULL)
+ PRE_MEM_RASCIIZ( "unveil(path)", ARG1 );
+ if (ARG2 != (UWord)NULL)
+ PRE_MEM_RASCIIZ( "unveil(permissions)", ARG2 );
+}
+
PRE(sys_getsockname)
{
PRINT("sys_getsockname ( %ld, %#lx, %#lx )",ARG1,ARG2,ARG3);
@@ -4079,7 +4093,7 @@
BSDX_(__NR_sigsuspend, sys_sigsuspend), // 111
BSDX_(__NR_sendsyslog, sys_sendsyslog), // 112
// obsol orecvmsg // 113
- // obsol osendmsg // 114
+ BSDX_(__NR_unveil, sys_unveil), // 114
// obsol vtrace // 115
BSDX_(__NR_getsockopt, sys_getsockopt), // 118
Only in pobj/valgrind-3.10.1/valgrind-3.10.1/coregrind/m_syswrap: syswrap-openbsd.c.orig

View File

@ -0,0 +1,10 @@
--- include/vki/vki-scnums-openbsd.h.orig
+++ include/vki/vki-scnums-openbsd.h
@@ -146,6 +146,7 @@
#define __NR_pselect 110
#define __NR_sigsuspend 111
#define __NR_sendsyslog 112
+#define __NR_unveil 114
#define __NR_getsockopt 118
#define __NR_thrkill 119
#define __NR_readv 120