Bug 249402 - Passing not existing policy file name causes segmentation fault.
Summary: Passing not existing policy file name causes segmentation fault.
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: setools
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Daniel Walsh
QA Contact: Milos Malik
Depends On:
Blocks: 249407
TreeView+ depends on / blocked
Reported: 2007-07-24 13:29 UTC by Eduard Benes
Modified: 2018-08-02 07:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-03-19 14:11:06 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Eduard Benes 2007-07-24 13:29:22 UTC
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):

How reproducible:

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
[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.

Comment 4 Daniel Walsh 2013-03-19 14:11:06 UTC
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.