Module Name: src Committed By: msaitoh Date: Tue Apr 16 03:47:14 UTC 2019
Modified Files: src/sys/kern [netbsd-8]: sys_mqueue.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.39.10.1 src/sys/kern/sys_mqueue.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/sys_mqueue.c diff -u src/sys/kern/sys_mqueue.c:1.39 src/sys/kern/sys_mqueue.c:1.39.10.1 --- src/sys/kern/sys_mqueue.c:1.39 Mon Jun 29 15:44:45 2015 +++ src/sys/kern/sys_mqueue.c Tue Apr 16 03:47:14 2019 @@ -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 @@ mq_send1(mqd_t mqdes, const char *msg_pt 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;