All of lore.kernel.org
 help / color / mirror / Atom feed
* Segmentation fault in context_type_get()
@ 2012-09-02 11:42 Gaurav Kumar
  2012-09-02 13:41 ` Gaurav Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Gaurav Kumar @ 2012-09-02 11:42 UTC (permalink / raw)
  To: SELinux

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

Hi,

When I try to compile this program http://pastebin.com/VY958hLD (refer
http://www.internet-goods.com/?p=42 for original code)  I get segmentation
fault. Seems to be an issue with *context_type_get*

*root@devUbuntu:/home/user1/dev# gdb ./a.out*
*GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04*
*Copyright (C) 2012 Free Software Foundation, Inc.*
*License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>*
*This is free software: you are free to change and redistribute it.*
*There is NO WARRANTY, to the extent permitted by law.  Type "show copying"*
*and "show warranty" for details.*
*This GDB was configured as "x86_64-linux-gnu".*
*For bug reporting instructions, please see:*
*<http://bugs.launchpad.net/gdb-linaro/>...*
*Reading symbols from /home/**user1* */dev/a.out...done.*
*(gdb) run*
*Starting program: /home/**user1* */dev/a.out*
*Checking if selinux is enabled…*
*this program is not running on a SELinux kernel*
*getting this program’s current context…*
*this program's security_context_t is: = unconfined*
*
*
*Calling context_type_get*
*
*
*Program received signal SIGSEGV, Segmentation fault.*
*0x00007ffff7bc5a20 in context_type_get () from
/lib/x86_64-linux-gnu/libselinux.so.1*
*(gdb)*


I am compiling code as "gcc tmp.c -lselinux -ggdb" on Ubuntu 12.04.

Is this an issue with selinux on Ubuntu? If not, can you please provide an
example of how to call context_type_get()

Thanks,
Gaurav

[-- Attachment #2: Type: text/html, Size: 2299 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segmentation fault in context_type_get()
  2012-09-02 11:42 Segmentation fault in context_type_get() Gaurav Kumar
@ 2012-09-02 13:41 ` Gaurav Kumar
  2012-09-04 14:05   ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Gaurav Kumar @ 2012-09-02 13:41 UTC (permalink / raw)
  To: SELinux

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

Nevermind, I think it is Ubuntu issue. Code works just fine on Fedora &
Redhat. I think selinux support in Ubuntu is limited and the library could
be buggy- I'll file a bug at launchpad.

Cheers,
Gaurav

On Sun, Sep 2, 2012 at 4:42 AM, Gaurav Kumar <gk@pivotalsecurity.com> wrote:

> Hi,
>
> When I try to compile this program http://pastebin.com/VY958hLD (refer
> http://www.internet-goods.com/?p=42 for original code)  I get
> segmentation fault. Seems to be an issue with *context_type_get*
>
> *root@devUbuntu:/home/user1/dev# gdb ./a.out*
> *GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04*
> *Copyright (C) 2012 Free Software Foundation, Inc.*
> *License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>*
> *This is free software: you are free to change and redistribute it.*
> *There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"*
> *and "show warranty" for details.*
> *This GDB was configured as "x86_64-linux-gnu".*
> *For bug reporting instructions, please see:*
> *<http://bugs.launchpad.net/gdb-linaro/>...*
> *Reading symbols from /home/**user1* */dev/a.out...done.*
> *(gdb) run*
> *Starting program: /home/**user1* */dev/a.out*
> *Checking if selinux is enabled…*
> *this program is not running on a SELinux kernel*
> *getting this program’s current context…*
> *this program's security_context_t is: = unconfined*
> *
> *
> *Calling context_type_get*
> *
> *
> *Program received signal SIGSEGV, Segmentation fault.*
> *0x00007ffff7bc5a20 in context_type_get () from
> /lib/x86_64-linux-gnu/libselinux.so.1*
> *(gdb)*
>
>
> I am compiling code as "gcc tmp.c -lselinux -ggdb" on Ubuntu 12.04.
>
> Is this an issue with selinux on Ubuntu? If not, can you please provide an
> example of how to call context_type_get()
>
> Thanks,
> Gaurav
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3139 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segmentation fault in context_type_get()
  2012-09-02 13:41 ` Gaurav Kumar
@ 2012-09-04 14:05   ` Stephen Smalley
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2012-09-04 14:05 UTC (permalink / raw)
  To: Gaurav Kumar; +Cc: SELinux

On Sun, 2012-09-02 at 06:41 -0700, Gaurav Kumar wrote:
> Nevermind, I think it is Ubuntu issue. Code works just fine on Fedora
> & Redhat. I think selinux support in Ubuntu is limited and the library
> could be buggy- I'll file a bug at launchpad.

Running it under valgrind might be helpful.

> 
> Cheers,
> Gaurav
> 
> On Sun, Sep 2, 2012 at 4:42 AM, Gaurav Kumar <gk@pivotalsecurity.com>
> wrote:
>         Hi, 
>         
>         
>         When I try to compile this
>         program http://pastebin.com/VY958hLD (refer http://www.internet-goods.com/?p=42 for original code)  I get segmentation fault. Seems to be an issue with context_type_get
>         
>         
>         root@devUbuntu:/home/user1/dev# gdb ./a.out
>         GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
>         Copyright (C) 2012 Free Software Foundation, Inc.
>         License GPLv3+: GNU GPL version 3 or later
>         <http://gnu.org/licenses/gpl.html>
>         This is free software: you are free to change and redistribute
>         it.
>         There is NO WARRANTY, to the extent permitted by law.  Type
>         "show copying"
>         and "show warranty" for details.
>         This GDB was configured as "x86_64-linux-gnu".
>         For bug reporting instructions, please see:
>         <http://bugs.launchpad.net/gdb-linaro/>...
>         Reading symbols from /home/user1 /dev/a.out...done.
>         (gdb) run
>         Starting program: /home/user1 /dev/a.out
>         Checking if selinux is enabled…
>         this program is not running on a SELinux kernel
>         getting this program’s current context…
>         this program's security_context_t is: = unconfined
>         
>         
>         Calling context_type_get
>         
>         
>         Program received signal SIGSEGV, Segmentation fault.
>         0x00007ffff7bc5a20 in context_type_get ()
>         from /lib/x86_64-linux-gnu/libselinux.so.1
>         (gdb)
>         
>         
>         
>         
>         I am compiling code as "gcc tmp.c -lselinux -ggdb" on Ubuntu
>         12.04.
>         
>         
>         Is this an issue with selinux on Ubuntu? If not, can you
>         please provide an example of how to call context_type_get()
>         
>         
>         Thanks,
>         Gaurav
>         
>         
>         
>         
>         
>         
> 
> 

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-04 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-02 11:42 Segmentation fault in context_type_get() Gaurav Kumar
2012-09-02 13:41 ` Gaurav Kumar
2012-09-04 14:05   ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.