Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Constraint 'blkcnt' of lfs_markv() syscall by 64...
details: https://anonhg.NetBSD.org/src/rev/d339cebf1a3f
branches: trunk
changeset: 513543:d339cebf1a3f
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Aug 03 06:02:42 2001 +0000
description:
Constraint 'blkcnt' of lfs_markv() syscall by 64KB. Reviewed by
Konrad Schroder <perseant%NetBSD.org@localhost>.
diffstat:
sys/ufs/lfs/lfs_syscalls.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diffs (39 lines):
diff -r 1463b16c3bc1 -r d339cebf1a3f sys/ufs/lfs/lfs_syscalls.c
--- a/sys/ufs/lfs/lfs_syscalls.c Fri Aug 03 06:00:13 2001 +0000
+++ b/sys/ufs/lfs/lfs_syscalls.c Fri Aug 03 06:02:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_syscalls.c,v 1.57 2001/07/13 20:30:24 perseant Exp $ */
+/* $NetBSD: lfs_syscalls.c,v 1.58 2001/08/03 06:02:42 jdolecek Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -95,6 +95,9 @@
#define FVG_UNLOCK 0x01 /* Needs to be unlocked */
#define FVG_PUT 0x02 /* Needs to be vput() */
+/* Max block count for lfs_markv() */
+#define MARKV_MAXBLKCNT 65536
+
struct buf *lfs_fakebuf(struct vnode *, int, size_t, caddr_t);
int lfs_fasthashget(dev_t, ino_t, int *, struct vnode **);
@@ -157,6 +160,9 @@
return (error);
blkcnt = SCARG(uap, blkcnt);
+ if ((u_int) blkcnt > MARKV_MAXBLKCNT)
+ return (EINVAL);
+
blkiov = malloc(blkcnt * sizeof(BLOCK_INFO), M_SEGMENT, M_WAITOK);
if ((error = copyin(SCARG(uap, blkiov), blkiov,
blkcnt * sizeof(BLOCK_INFO))) != 0)
@@ -190,6 +196,9 @@
return (error);
blkcnt = SCARG(uap, blkcnt);
+ if ((u_int) blkcnt > MARKV_MAXBLKCNT)
+ return (EINVAL);
+
blkiov = malloc(blkcnt * sizeof(BLOCK_INFO), M_SEGMENT, M_WAITOK);
blkiov15 = malloc(blkcnt * sizeof(BLOCK_INFO_15), M_SEGMENT, M_WAITOK);
if ((error = copyin(SCARG(uap, blkiov), blkiov15,
Home |
Main Index |
Thread Index |
Old Index