summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/exec_elf.c18
-rw-r--r--sys/kern/kern_sig.c12
-rw-r--r--sys/uvm/uvm_unix.c6
3 files changed, 33 insertions, 3 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index cc36728bd2b..ae1a0af51d7 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.69 2009/03/08 14:28:52 kettenis Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.70 2009/06/06 21:25:19 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -947,6 +947,9 @@ int ELFNAMEEND(coredump_writenote)(struct proc *, void *, Elf_Note *,
int
ELFNAMEEND(coredump)(struct proc *p, void *cookie)
{
+#ifdef SMALL_KERNEL
+ return EPERM;
+#else
Elf_Ehdr ehdr;
Elf_Phdr phdr, *psections;
struct countsegs_state cs;
@@ -1085,15 +1088,18 @@ ELFNAMEEND(coredump)(struct proc *p, void *cookie)
out:
return (error);
+#endif
}
int
ELFNAMEEND(coredump_countsegs)(struct proc *p, void *iocookie,
struct uvm_coredump_state *us)
{
+#ifndef SMALL_KERNEL
struct countsegs_state *cs = us->cookie;
cs->npsections++;
+#endif
return (0);
}
@@ -1101,6 +1107,7 @@ int
ELFNAMEEND(coredump_writeseghdrs)(struct proc *p, void *iocookie,
struct uvm_coredump_state *us)
{
+#ifndef SMALL_KERNEL
struct writesegs_state *ws = us->cookie;
Elf_Phdr phdr;
vsize_t size, realsize;
@@ -1125,6 +1132,7 @@ ELFNAMEEND(coredump_writeseghdrs)(struct proc *p, void *iocookie,
ws->secoff += phdr.p_filesz;
*ws->psections++ = phdr;
+#endif
return (0);
}
@@ -1132,6 +1140,7 @@ ELFNAMEEND(coredump_writeseghdrs)(struct proc *p, void *iocookie,
int
ELFNAMEEND(coredump_notes)(struct proc *p, void *iocookie, size_t *sizep)
{
+#ifndef SMALL_KERNEL
struct ps_strings pss;
struct iovec iov;
struct uio uio;
@@ -1277,12 +1286,14 @@ ELFNAMEEND(coredump_notes)(struct proc *p, void *iocookie, size_t *sizep)
#endif
*sizep = size;
+#endif
return (0);
}
int
ELFNAMEEND(coredump_note)(struct proc *p, void *iocookie, size_t *sizep)
{
+#ifndef SMALL_KERNEL
Elf_Note nhdr;
int size, notesize, error;
int namesize;
@@ -1338,6 +1349,7 @@ ELFNAMEEND(coredump_note)(struct proc *p, void *iocookie, size_t *sizep)
*sizep = size;
/* XXX Add hook for machdep per-LWP notes. */
+#endif
return (0);
}
@@ -1345,6 +1357,9 @@ int
ELFNAMEEND(coredump_writenote)(struct proc *p, void *cookie, Elf_Note *nhdr,
const char *name, void *data)
{
+#ifdef SMALL_KERNEL
+ return EPERM;
+#else
int error;
error = coredump_write(cookie, UIO_SYSSPACE, nhdr, sizeof(*nhdr));
@@ -1357,4 +1372,5 @@ ELFNAMEEND(coredump_writenote)(struct proc *p, void *cookie, Elf_Note *nhdr,
return error;
return coredump_write(cookie, UIO_SYSSPACE, data, nhdr->descsz);
+#endif
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index f2703de2e4f..b6967c58926 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.104 2009/06/05 03:57:32 ray Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.105 2009/06/06 21:25:19 deraadt Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1394,6 +1394,9 @@ struct coredump_iostate {
int
coredump(struct proc *p)
{
+#ifdef SMALL_KERNEL
+ return EPERM;
+#else
struct vnode *vp;
struct ucred *cred = p->p_ucred;
struct vmspace *vm = p->p_vmspace;
@@ -1475,11 +1478,15 @@ out:
if (error == 0)
error = error1;
return (error);
+#endif
}
int
coredump_trad(struct proc *p, void *cookie)
{
+#ifdef SMALL_KERNEL
+ return EPERM;
+#else
struct coredump_iostate *io = cookie;
struct vmspace *vm = io->io_proc->p_vmspace;
struct vnode *vp = io->io_vp;
@@ -1510,8 +1517,10 @@ coredump_trad(struct proc *p, void *cookie)
(int)core.c_hdrsize, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, cred, NULL, p);
return (error);
+#endif
}
+#ifndef SMALL_KERNEL
int
coredump_write(void *cookie, enum uio_seg segflg, const void *data, size_t len)
{
@@ -1532,6 +1541,7 @@ coredump_write(void *cookie, enum uio_seg segflg, const void *data, size_t len)
io->io_offset += len;
return (0);
}
+#endif /* !SMALL_KERNEL */
/*
* Nonexistent system call-- signal process (may want to handle it).
diff --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c
index 192faf6c106..f5d33a3e188 100644
--- a/sys/uvm/uvm_unix.c
+++ b/sys/uvm/uvm_unix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_unix.c,v 1.36 2009/03/20 15:19:04 oga Exp $ */
+/* $OpenBSD: uvm_unix.c,v 1.37 2009/06/06 21:25:21 deraadt Exp $ */
/* $NetBSD: uvm_unix.c,v 1.18 2000/09/13 15:00:25 thorpej Exp $ */
/*
@@ -147,6 +147,8 @@ uvm_grow(struct proc *p, vaddr_t sp)
vm->vm_ssize += si;
}
+#ifndef SMALL_KERNEL
+
/*
* uvm_coredump: dump core!
*/
@@ -320,3 +322,5 @@ uvm_coredump_walkmap(struct proc *p, void *iocookie,
return (0);
}
+
+#endif /* !SMALL_KERNEL */