Source-Changes-HG archive

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

[src/netbsd-7-0]: src/sys/kern Pull up following revision(s) (requested by ma...



details:   https://anonhg.NetBSD.org/src/rev/fa3d2e058fd9
branches:  netbsd-7-0
changeset: 450495:fa3d2e058fd9
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 16 03:53:25 2019 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1688):
        sys/kern/sys_mqueue.c: revision 1.44
mq_send1: fix argument validation and reject too large lengths early.
Discovered by Andy Nguyen.

diffstat:

 sys/kern/sys_mqueue.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r b58c8c76b4ca -r fa3d2e058fd9 sys/kern/sys_mqueue.c
--- a/sys/kern/sys_mqueue.c     Wed Mar 13 12:36:14 2019 +0000
+++ b/sys/kern/sys_mqueue.c     Tue Apr 16 03:53:25 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_mqueue.c,v 1.36 2014/02/25 18:30:11 pooka Exp $    */
+/*     $NetBSD: sys_mqueue.c,v 1.36.6.1 2019/04/16 03:53:25 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2007-2011 Mindaugas Rasiukevicius <rmind at NetBSD org>
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.36 2014/02/25 18:30:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.36.6.1 2019/04/16 03:53:25 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -794,6 +794,8 @@
                return EINVAL;
 
        /* Allocate a new message */
+       if (msg_len > mq_max_msgsize)
+               return EMSGSIZE;
        size = sizeof(struct mq_msg) + msg_len;
        if (size > mq_max_msgsize)
                return EMSGSIZE;



Home | Main Index | Thread Index | Old Index