Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys utrace(2): limit size of user data to KTR_USER_MAXLEN (c...
details: https://anonhg.NetBSD.org/src/rev/c725db9f135e
branches: trunk
changeset: 501698:c725db9f135e
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Jan 05 22:25:26 2001 +0000
description:
utrace(2): limit size of user data to KTR_USER_MAXLEN (currently 2048); return EINVAL if 'len' is bigger
diffstat:
sys/kern/kern_ktrace.c | 5 ++++-
sys/sys/ktrace.h | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diffs (36 lines):
diff -r bcc42a01ad43 -r c725db9f135e sys/kern/kern_ktrace.c
--- a/sys/kern/kern_ktrace.c Fri Jan 05 21:53:38 2001 +0000
+++ b/sys/kern/kern_ktrace.c Fri Jan 05 22:25:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_ktrace.c,v 1.52 2001/01/05 21:42:09 jdolecek Exp $ */
+/* $NetBSD: kern_ktrace.c,v 1.53 2001/01/05 22:25:26 jdolecek Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -673,6 +673,9 @@
if (!KTRPOINT(p, KTR_USER))
return (0);
+ if (SCARG(uap, len) > KTR_USER_MAXLEN)
+ return (EINVAL);
+
ktruser(p, SCARG(uap, label), SCARG(uap, addr), SCARG(uap, len), 1);
return (0);
diff -r bcc42a01ad43 -r c725db9f135e sys/sys/ktrace.h
--- a/sys/sys/ktrace.h Fri Jan 05 21:53:38 2001 +0000
+++ b/sys/sys/ktrace.h Fri Jan 05 22:25:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ktrace.h,v 1.21 2000/12/28 11:10:17 jdolecek Exp $ */
+/* $NetBSD: ktrace.h,v 1.22 2001/01/05 22:25:27 jdolecek Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -145,6 +145,7 @@
*/
#define KTR_USER 8
#define KTR_USER_MAXIDLEN 20
+#define KTR_USER_MAXLEN 2048 /* maximum length of passed data */
struct ktr_user {
char ktr_id[KTR_USER_MAXIDLEN]; /* string id of caller */
/*
Home |
Main Index |
Thread Index |
Old Index