Bug 249402 - Passing not existing policy file name causes segmentation fault.
Passing not existing policy file name causes segmentation fault.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: setools (Show other bugs)
5.0
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Milos Malik
:
Depends On:
Blocks: 249407
  Show dependency treegraph
 
Reported: 2007-07-24 09:29 EDT by Eduard Benes
Modified: 2013-04-12 15:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-19 10:11:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Eduard Benes 2007-07-24 09:29:22 EDT
Description of problem:
Running seinfo tool with option and specified policy file that does not exist 
causes segmentation fault. 

Version-Release number of selected component (if applicable):
setools-3.0-3.el5
setools-3.0-2.fc6
setools-3.1-4.fc7

How reproducible:
always

Steps to Reproduce:
1. seinfo -u AnyNonPolicyFileName
Instead of "-u" can be used any other option {c,t,a, ...}
  
Actual results:
Segmentation fault.

Expected results:
Should not segfault ...

Additional info:
This seems to be fixed in setools version 3.2-3 included in rawhide.

[root@pipa01 ~]# seinfo -u xyz
Rule loading disabled
Segmentation fault
[root@pipa01 ~]# rpm -q setools
setools-3.0-3.el5
[root@pipa01 ~]# gdb seinfo
GNU gdb Red Hat Linux (6.5-16.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db 
library "/lib/libthread_db.so.1".

(gdb) run -u xyz
Starting program: /usr/bin/seinfo -u xyz
Rule loading disabled

Program received signal SIGSEGV, Segmentation fault.
qpol_open_policy_from_file_no_rules (path=0x8ae23d0 "xyz", policy=0x8ae23e0, 
fn=0x61f350 <qpol_handle_route_to_callback>, varg=0x8ae23e0) at policy.c:995
995     policy.c: No such file or directory.
        in policy.c
(gdb) bt
#0  qpol_open_policy_from_file_no_rules (path=0x8ae23d0 "xyz", 
policy=0x8ae23e0, fn=0x61f350 <qpol_handle_route_to_callback>, varg=0x8ae23e0)
    at policy.c:995
#1  0x0061f5bf in apol_policy_open_no_rules (path=0x8ae23d0 "xyz", 
policy=0xbf98c3e4, msg_callback=0, callback_arg=0x0) at policy.c:134
#2  0x0804d4a2 in main (argc=3, argv=0xbf98c494) at seinfo.c:1375
#3  0x00125dec in __libc_start_main () from /lib/libc.so.6
#4  0x0804a741 in _start ()

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
Comment 4 Daniel Walsh 2013-03-19 10:11:06 EDT
I believe this is fixed in current release.

Note You need to log in before you can comment on or make changes to this bug.