Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2018 17:11:08 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337465 - stable/11/sys/security/mac
Message-ID:  <201808081711.w78HB8oB087951@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Aug  8 17:11:07 2018
New Revision: 337465
URL: https://svnweb.freebsd.org/changeset/base/337465

Log:
  MFC r337031:
  Require that MAC label buffers be able to store a non-empty string.

Modified:
  stable/11/sys/security/mac/mac_framework.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/security/mac/mac_framework.c
==============================================================================
--- stable/11/sys/security/mac/mac_framework.c	Wed Aug  8 17:10:32 2018	(r337464)
+++ stable/11/sys/security/mac/mac_framework.c	Wed Aug  8 17:11:07 2018	(r337465)
@@ -586,7 +586,9 @@ int
 mac_check_structmac_consistent(struct mac *mac)
 {
 
-	if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
+	/* Require that labels have a non-zero length. */
+	if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN ||
+	    mac->m_buflen <= sizeof(""))
 		return (EINVAL);
 
 	return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808081711.w78HB8oB087951>