Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by mart...



details:   https://anonhg.NetBSD.org/src/rev/201bad8e7894
branches:  netbsd-8
changeset: 450491:201bad8e7894
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 16 03:47:14 2019 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1230):
        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 319c1eda21a1 -r 201bad8e7894 sys/kern/sys_mqueue.c
--- a/sys/kern/sys_mqueue.c     Wed Apr 10 07:40:36 2019 +0000
+++ b/sys/kern/sys_mqueue.c     Tue Apr 16 03:47:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_mqueue.c,v 1.39 2015/06/29 15:44:45 christos Exp $ */
+/*     $NetBSD: sys_mqueue.c,v 1.39.10.1 2019/04/16 03:47:14 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.39 2015/06/29 15:44:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.39.10.1 2019/04/16 03:47:14 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -811,6 +811,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