Bug 471147

Summary: segfault in checkmodule while compiling a policy module
Product: [Fedora] Fedora Reporter: Carl Roth <roth>
Component: checkpolicyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 10CC: dwalsh, jbrindle, mgrepl, rs, sdsmall
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-11 14:48:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample policy, including gdb backtrace
none
diff between f9 and f10 compiled policy ('tmp') files none

Description Carl Roth 2008-11-12 00:37:38 UTC
Description of problem:

I have a small policy module that I use with F9 and was hoping to migrate it to F10...  When I compile the policy it segfaults in 'checkmodule'.

Version-Release number of selected component (if applicable):

checkpolicy-2.0.16-3.fc10.i386
selinux-policy-targeted-3.5.13-18.fc10.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Carl Roth 2008-11-12 00:39:28 UTC
Created attachment 323280 [details]
sample policy, including gdb backtrace

Comment 2 Carl Roth 2008-11-12 19:22:45 UTC
I don't know if this is interesting, but I compiled the same policy with F9:

  checkpolicy-2.0.16-3.fc9.x86_64
  selinux-policy-targeted-3.3.1-107.fc9.noarch

and it compiles fine.  I'm attaching a diff of the two 'tmp' intermediate files.

Comment 3 Carl Roth 2008-11-12 19:25:06 UTC
Created attachment 323375 [details]
diff between f9 and f10 compiled policy ('tmp') files

Comment 4 Carl Roth 2008-11-12 19:47:32 UTC
I also did some experiments by mixing and matching the '.tmp' intermediate file with the offending command line:

  /usr/bin/checkmodule -M -m -o tmp/ursus-config-pyzor.mod tmp/ursus-config-pyzor.tmp

* the ursus-config-pyzor.tmp file from F9 works fine with checkmodule for f9 and for f10.
* the ursus-config-pyzor.tmp file from F10 crashes with checkmodule for f9 and for f10.

I don't understand too much more about checkmodule itelf, other than that the backtrace indicates it's choking on the 'user_pyzor_home_t' symbol.  I didn't attach the actual core file since that somewhat large.

Comment 5 Daniel Walsh 2008-11-14 20:49:21 UTC
If you just remove 

#  type user_pyzor_home_t;

It works.

Comment 6 Daniel Walsh 2008-11-14 20:56:01 UTC
This policy will cause the compiler to crash

policy_module(test, 1.0)

gen_require(`
  type a_t;
')
type b_t alias a_t;


If you require a type that has been aliased by another type.

Comment 7 Bug Zapper 2008-11-26 05:13:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Robert Story 2009-07-03 22:26:47 UTC
Any progress on this? I'm seeing this on F9..

Comment 9 Daniel Walsh 2009-07-06 02:02:05 UTC
This has been reported to Upstream, but I am not sure where they are on it.  Moving to rawhide.

Comment 10 Stephen Smalley 2009-07-06 11:41:37 UTC
Your test case in comment 6 compiles fine with the checkmodule in F11.
IIRC, this was fixed in checkpolicy 2.0.19 and libsepol 2.0.35 upstream.

Comment 11 Daniel Walsh 2009-07-06 18:39:30 UTC
Ok Carl do you want this to be back ported to F10 or is fixed in F11 good enough?

Comment 12 Bug Zapper 2009-11-18 07:58:28 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 13 Miroslav Grepl 2009-12-11 14:48:37 UTC
I am closing it as WONTFIX as per the comment #11.