Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern copyinargs: Redo previous; if given fakearg is long...



details:   https://anonhg.NetBSD.org/src/rev/07d79a316855
branches:  trunk
changeset: 328700:07d79a316855
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Mon Apr 14 13:14:38 2014 +0000

description:
copyinargs: Redo previous; if given fakearg is longer than arg buf (which is
very unlikely to happen), there's no point to continue with truncated arg.
Just give up and return E2BIG.

diffstat:

 sys/kern/kern_exec.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 7f9aa35e69fa -r 07d79a316855 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Mon Apr 14 13:04:44 2014 +0000
+++ b/sys/kern/kern_exec.c      Mon Apr 14 13:14:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.394 2014/04/14 05:39:19 uebayasi Exp $ */
+/*     $NetBSD: kern_exec.c,v 1.395 2014/04/14 13:14:38 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.394 2014/04/14 05:39:19 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.395 2014/04/14 13:14:38 uebayasi Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1423,7 +1423,7 @@
                        if (len < maxlen)
                                len++;
                        else
-                               len = maxlen;
+                               return E2BIG;
                        ktrexecarg(tmpfap->fa_arg, len - 1);
                        dp += len;
 



Home | Main Index | Thread Index | Old Index