Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 2020 23:21:04 +0000 (UTC)
From:      Ed Maste <emaste@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: r358792 - stable/11/sys/netpfil/pf
Message-ID:  <202003082321.028NL43v095649@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Mar  8 23:21:04 2020
New Revision: 358792
URL: https://svnweb.freebsd.org/changeset/base/358792

Log:
  MFC r350294: pf: zero output buffer in pfioctl
  
  Avoid potential structure padding leak.
  
  Reported by:	Vlad Tsyrklevich <vlad@tsyrklevich.net>
  Security:	Potential kernel memory disclosure
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/sys/netpfil/pf/pf_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/pf_ioctl.c
==============================================================================
--- stable/11/sys/netpfil/pf/pf_ioctl.c	Sun Mar  8 23:20:24 2020	(r358791)
+++ stable/11/sys/netpfil/pf/pf_ioctl.c	Sun Mar  8 23:21:04 2020	(r358792)
@@ -1765,7 +1765,7 @@ relock_DIOCKILLSTATES:
 			break;
 		}
 
-		p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK);
+		p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK | M_ZERO);
 		nr = 0;
 
 		for (i = 0; i <= pf_hashmask; i++) {



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