Bug 183817 - [mac] kernel compiled with options INVARIANTS and MAC_PORTACL panices if loader loads mac_portacl.ko too
Summary: [mac] kernel compiled with options INVARIANTS and MAC_PORTACL panices if load...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords: crash, easy
: 186362 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-09 18:20 UTC by Eugene Grosbein
Modified: 2018-03-06 10:11 UTC (History)
2 users (show)

See Also:
koobs: mfc-stable11+
koobs: mfc-stable10+


Attachments
file.diff (398 bytes, patch)
2013-11-09 18:20 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2013-11-09 18:20:00 UTC
		
	If the kernel is compiled with options INVARIANTS and options MAC_PORTACL
	and /boot/loader.conf has "mac_portacl_load=YES" then kernel panices
	as soon as /etc/rc.d/initrandom script runs "sysctl -a" at boot time:
	http://www.grosbein.net/files/portacl.jpg

How-To-Repeat: 	Build custom kernel with options INVARIANTS and options MAC_PORTACL,
	have "mac_portacl_load=YES" in /boot/loader.conf and try to boot.
Comment 1 Eugene Grosbein 2015-12-10 10:36:07 UTC
As 2 years ago for 9.2-STABLE, there is still the same problem for 10.2-STABLE and attached patch helps.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-10 10:44:53 UTC
Reset to Open (No In Progress without Assignee)

Thank you for the update Eugen!
Comment 3 Eugene Grosbein freebsd_committer freebsd_triage 2017-09-09 19:55:58 UTC
*** Bug 186362 has been marked as a duplicate of this bug. ***
Comment 4 Eugene Grosbein freebsd_committer freebsd_triage 2017-09-19 17:48:39 UTC
My PR.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-02-25 23:11:07 UTC
A commit references this bug:

Author: eugen
Date: Sun Feb 25 23:10:13 UTC 2018
New revision: 329994
URL: https://svnweb.freebsd.org/changeset/base/329994

Log:
  mac_portacl(4): stop panicing INVARIANTS-enabled kernel by loading .ko
  when kernel already has options MAC_PORTACL.

  PR:		183817
  Approved by:	avg (mentor)
  MFC after:	1 week

Changes:
  head/sys/security/mac_portacl/mac_portacl.c
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-03-05 12:17:19 UTC
A commit references this bug:

Author: eugen
Date: Mon Mar  5 12:16:37 UTC 2018
New revision: 330499
URL: https://svnweb.freebsd.org/changeset/base/330499

Log:
  MFC r329994: mac_portacl(4): stop panicing INVARIANTS-enabled kernel by loading .ko
  when kernel already has options MAC_PORTACL.

  PR:		183817
  Approved by:	avg (mentor)

Changes:
_U  stable/11/
  stable/11/sys/security/mac_portacl/mac_portacl.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-03-05 12:22:26 UTC
A commit references this bug:

Author: eugen
Date: Mon Mar  5 12:21:36 UTC 2018
New revision: 330500
URL: https://svnweb.freebsd.org/changeset/base/330500

Log:
  MFC r329994: mac_portacl(4): stop panicing INVARIANTS-enabled kernel by loading .ko
  when kernel already has options MAC_PORTACL.

  PR:		183817
  Approved by:	avg (mentor)

Changes:
_U  stable/10/
  stable/10/sys/security/mac_portacl/mac_portacl.c