Skip to content

Commit

Permalink
mincore() is a relic from the past, exposing physical machine informa…
Browse files Browse the repository at this point in the history
…tion

about shared resources which no program should see.  only a few pieces of
software use it, generally poorly thought out.  they are being fixed, so
mincore() can be deleted.
ok guenther tedu jca sthen, others
  • Loading branch information
deraadt committed Jan 11, 2019
1 parent cf52cfb commit 54e4f6b
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 167 deletions.
2 changes: 0 additions & 2 deletions lib/libc/Symbols.list
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ _thread_sys_listen
_thread_sys_lseek
_thread_sys_lstat
_thread_sys_madvise
_thread_sys_mincore
_thread_sys_minherit
_thread_sys_mkdir
_thread_sys_mkdirat
Expand Down Expand Up @@ -325,7 +324,6 @@ listen
lseek
lstat
madvise
mincore
minherit
mkdir
mkdirat
Expand Down
3 changes: 1 addition & 2 deletions lib/libc/hidden/sys/mman.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: mman.h,v 1.3 2016/05/07 19:05:22 guenther Exp $ */
/* $OpenBSD: mman.h,v 1.4 2019/01/11 18:46:30 deraadt Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
Expand All @@ -21,7 +21,6 @@
#include_next <sys/mman.h>

PROTO_NORMAL(madvise);
PROTO_NORMAL(mincore);
PROTO_NORMAL(minherit);
PROTO_NORMAL(mlock);
PROTO_NORMAL(mlockall);
Expand Down
2 changes: 1 addition & 1 deletion lib/libc/shlib_version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
major=93
major=94
minor=0
# note: If changes were made to include/thread_private.h or if system
# calls were added/changed then librthread/shlib_version also be updated.
6 changes: 3 additions & 3 deletions lib/libc/sys/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.155 2018/07/13 09:25:22 beck Exp $
# $OpenBSD: Makefile.inc,v 1.156 2019/01/11 18:46:30 deraadt Exp $
# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93

Expand Down Expand Up @@ -56,7 +56,7 @@ ASM= __semctl.o __syscall.o __thrsigdivert.o \
getrlimit.o getrusage.o getsid.o getsockname.o \
getsockopt.o gettimeofday.o ioctl.o \
kevent.o kill.o kqueue.o ktrace.o lchown.o \
link.o linkat.o listen.o lstat.o madvise.o mincore.o \
link.o linkat.o listen.o lstat.o madvise.o \
minherit.o mkdir.o mkdirat.o mkfifo.o mkfifoat.o \
mknod.o mknodat.o mlock.o mlockall.o mount.o mprotect.o \
msgctl.o msgget.o munlock.o munlockall.o munmap.o \
Expand Down Expand Up @@ -183,7 +183,7 @@ MAN+= __get_tcb.2 __thrsigdivert.2 __thrsleep.2 _exit.2 accept.2 \
getrtable.2 getrusage.2 getsid.2 getsockname.2 getsockopt.2 \
getthrid.2 gettimeofday.2 getuid.2 intro.2 ioctl.2 issetugid.2 \
kbind.2 kill.2 kqueue.2 ktrace.2 link.2 listen.2 lseek.2 madvise.2 \
mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 \
minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 \
mlockall.2 mmap.2 mount.2 mprotect.2 mquery.2 msgctl.2 \
msgget.2 msgrcv.2 msgsnd.2 msync.2 munmap.2 nanosleep.2 \
nfssvc.2 open.2 pathconf.2 pipe.2 pledge.2 poll.2 profil.2 \
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/madvise.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: madvise.2,v 1.19 2014/07/10 13:42:53 guenther Exp $
.\" $OpenBSD: madvise.2,v 1.20 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: madvise.2,v 1.7 1995/12/27 21:17:02 jtc Exp $
.\"
.\" Copyright (c) 1991, 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)madvise.2 8.1 (Berkeley) 6/9/93
.\"
.Dd $Mdocdate: July 10 2014 $
.Dd $Mdocdate: January 11 2019 $
.Dt MADVISE 2
.Os
.Sh NAME
Expand Down Expand Up @@ -89,7 +89,6 @@ If successful, the
function will return zero.
Otherwise an error number will be returned to indicate the error.
.Sh SEE ALSO
.Xr mincore 2 ,
.Xr minherit 2 ,
.Xr mprotect 2 ,
.Xr msync 2 ,
Expand Down
66 changes: 0 additions & 66 deletions lib/libc/sys/mincore.2

This file was deleted.

5 changes: 2 additions & 3 deletions lib/libc/sys/minherit.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: minherit.2,v 1.15 2014/07/02 22:22:35 matthew Exp $
.\" $OpenBSD: minherit.2,v 1.16 2019/01/11 18:46:30 deraadt Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -29,7 +29,7 @@
.\"
.\" @(#)minherit.2 8.1 (Berkeley) 6/9/93
.\"
.Dd $Mdocdate: July 2 2014 $
.Dd $Mdocdate: January 11 2019 $
.Dt MINHERIT 2
.Os
.Sh NAME
Expand Down Expand Up @@ -86,7 +86,6 @@ argument is invalid.
.El
.Sh SEE ALSO
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr mprotect 2 ,
.Xr msync 2 ,
.Xr munmap 2
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/mlock.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: mlock.2,v 1.19 2014/11/15 14:41:02 bentley Exp $
.\" $OpenBSD: mlock.2,v 1.20 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: mlock.2,v 1.3 1995/06/24 10:42:03 cgd Exp $
.\"
.\" Copyright (c) 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)mlock.2 8.2 (Berkeley) 12/11/93
.\"
.Dd $Mdocdate: November 15 2014 $
.Dd $Mdocdate: January 11 2019 $
.Dt MLOCK 2
.Os
.Sh NAME
Expand Down Expand Up @@ -130,7 +130,6 @@ Some portion of the indicated address range is not locked.
.El
.Sh SEE ALSO
.Xr fork 2 ,
.Xr mincore 2 ,
.Xr minherit 2 ,
.Xr mlockall 2 ,
.Xr mmap 2 ,
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/mlockall.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: mlockall.2,v 1.9 2014/12/14 07:42:50 schwarze Exp $
.\" $OpenBSD: mlockall.2,v 1.10 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: mlockall.2,v 1.6 2000/06/26 17:00:02 kleink Exp $
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -29,7 +29,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: December 14 2014 $
.Dd $Mdocdate: January 11 2019 $
.Dt MLOCKALL 2
.Os
.Sh NAME
Expand Down Expand Up @@ -97,7 +97,6 @@ The calling process does not have the appropriate privileges to perform
the requested operation.
.El
.Sh SEE ALSO
.Xr mincore 2 ,
.Xr mlock 2 ,
.Xr mmap 2 ,
.Xr munmap 2 ,
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/mmap.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: mmap.2,v 1.59 2018/02/11 07:30:59 jmc Exp $
.\" $OpenBSD: mmap.2,v 1.60 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: mmap.2,v 1.5 1995/06/24 10:48:59 cgd Exp $
.\"
.\" Copyright (c) 1991, 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)mmap.2 8.1 (Berkeley) 6/4/93
.\"
.Dd $Mdocdate: February 11 2018 $
.Dd $Mdocdate: January 11 2019 $
.Dt MMAP 2
.Os
.Sh NAME
Expand Down Expand Up @@ -297,7 +297,6 @@ for more information).
.El
.Sh SEE ALSO
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr mlock 2 ,
.Xr mprotect 2 ,
.Xr mquery 2 ,
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/mprotect.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: mprotect.2,v 1.23 2018/01/12 04:36:44 deraadt Exp $
.\" $OpenBSD: mprotect.2,v 1.24 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: mprotect.2,v 1.6 1995/10/12 15:41:08 jtc Exp $
.\"
.\" Copyright (c) 1991, 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93
.\"
.Dd $Mdocdate: January 12 2018 $
.Dd $Mdocdate: January 11 2019 $
.Dt MPROTECT 2
.Os
.Sh NAME
Expand Down Expand Up @@ -114,7 +114,6 @@ argument is invalid or the specified address range would wrap around.
.El
.Sh SEE ALSO
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr msync 2 ,
.Xr munmap 2
.Sh STANDARDS
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/msync.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: msync.2,v 1.25 2015/10/29 12:03:46 tedu Exp $
.\" $OpenBSD: msync.2,v 1.26 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: msync.2,v 1.8 1995/10/12 15:41:09 jtc Exp $
.\"
.\" Copyright (c) 1991, 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)msync.2 8.1 (Berkeley) 6/9/93
.\"
.Dd $Mdocdate: October 29 2015 $
.Dd $Mdocdate: January 11 2019 $
.Dt MSYNC 2
.Os
.Sh NAME
Expand Down Expand Up @@ -97,7 +97,6 @@ An I/O error occurred while writing.
.El
.Sh SEE ALSO
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr minherit 2 ,
.Xr mprotect 2 ,
.Xr munmap 2
Expand Down
5 changes: 2 additions & 3 deletions lib/libc/sys/munmap.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: munmap.2,v 1.17 2016/04/09 04:04:09 guenther Exp $
.\" $OpenBSD: munmap.2,v 1.18 2019/01/11 18:46:30 deraadt Exp $
.\" $NetBSD: munmap.2,v 1.5 1995/02/27 12:35:03 cgd Exp $
.\"
.\" Copyright (c) 1991, 1993
Expand Down Expand Up @@ -30,7 +30,7 @@
.\"
.\" @(#)munmap.2 8.2 (Berkeley) 4/15/94
.\"
.Dd $Mdocdate: April 9 2016 $
.Dd $Mdocdate: January 11 2019 $
.Dt MUNMAP 2
.Os
.Sh NAME
Expand Down Expand Up @@ -65,7 +65,6 @@ valid address space.
.El
.Sh SEE ALSO
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr mlock 2 ,
.Xr mlockall 2 ,
.Xr mmap 2 ,
Expand Down
4 changes: 2 additions & 2 deletions lib/librthread/shlib_version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
major=25
minor=1
major=26
minor=0
5 changes: 2 additions & 3 deletions sys/kern/syscalls.master
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; $OpenBSD: syscalls.master,v 1.188 2018/07/30 19:09:51 mpi Exp $
; $OpenBSD: syscalls.master,v 1.189 2019/01/11 18:46:30 deraadt Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $

; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
Expand Down Expand Up @@ -179,8 +179,7 @@
const struct timeval *tptr); }
77 STD { int sys_futimes(int fd, \
const struct timeval *tptr); }
78 STD { int sys_mincore(void *addr, size_t len, \
char *vec); }
78 UNIMPL mincore
79 STD NOLOCK { int sys_getgroups(int gidsetsize, \
gid_t *gidset); }
80 STD { int sys_setgroups(int gidsetsize, \
Expand Down
3 changes: 1 addition & 2 deletions sys/sys/mman.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: mman.h,v 1.32 2018/02/11 05:11:50 deraadt Exp $ */
/* $OpenBSD: mman.h,v 1.33 2019/01/11 18:46:30 deraadt Exp $ */
/* $NetBSD: mman.h,v 1.11 1995/03/26 20:24:23 jtc Exp $ */

/*-
Expand Down Expand Up @@ -152,7 +152,6 @@ int mlockall(int);
int munlockall(void);
#if __BSD_VISIBLE
int madvise(void *, size_t, int);
int mincore(void *, size_t, char *);
int minherit(void *, size_t, int);
void * mquery(void *, size_t, int, int, int, off_t);
#endif
Expand Down
5 changes: 1 addition & 4 deletions sys/sys/syscall.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: syscall.h,v 1.198 2018/07/30 19:10:50 mpi Exp $ */
/* $OpenBSD: syscall.h,v 1.199 2019/01/11 18:46:30 deraadt Exp $ */

/*
* System call numbers.
Expand Down Expand Up @@ -237,9 +237,6 @@
/* syscall: "futimes" ret: "int" args: "int" "const struct timeval *" */
#define SYS_futimes 77

/* syscall: "mincore" ret: "int" args: "void *" "size_t" "char *" */
#define SYS_mincore 78

/* syscall: "getgroups" ret: "int" args: "int" "gid_t *" */
#define SYS_getgroups 79

Expand Down
9 changes: 1 addition & 8 deletions sys/sys/syscallargs.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: syscallargs.h,v 1.201 2018/07/30 19:10:50 mpi Exp $ */
/* $OpenBSD: syscallargs.h,v 1.202 2019/01/11 18:46:30 deraadt Exp $ */

/*
* System call argument lists.
Expand Down Expand Up @@ -370,12 +370,6 @@ struct sys_futimes_args {
syscallarg(const struct timeval *) tptr;
};

struct sys_mincore_args {
syscallarg(void *) addr;
syscallarg(size_t) len;
syscallarg(char *) vec;
};

struct sys_getgroups_args {
syscallarg(int) gidsetsize;
syscallarg(gid_t *) gidset;
Expand Down Expand Up @@ -1189,7 +1183,6 @@ int sys_mprotect(struct proc *, void *, register_t *);
int sys_madvise(struct proc *, void *, register_t *);
int sys_utimes(struct proc *, void *, register_t *);
int sys_futimes(struct proc *, void *, register_t *);
int sys_mincore(struct proc *, void *, register_t *);
int sys_getgroups(struct proc *, void *, register_t *);
int sys_setgroups(struct proc *, void *, register_t *);
int sys_getpgrp(struct proc *, void *, register_t *);
Expand Down
Loading

0 comments on commit 54e4f6b

Please sign in to comment.