Bug 881499 - With unconfined off, shellinabox can't bind to its own default port.
Summary: With unconfined off, shellinabox can't bind to its own default port.
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-29 01:13 UTC by Robin Powell
Modified: 2015-08-26 04:33 UTC (History)
4 users (show)

Fixed In Version: 3.13.1-141.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-26 04:33:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robin Powell 2012-11-29 01:13:33 UTC
Simple AVC:

type=AVC msg=audit(11/28/2012 16:57:32.369:23909) : avc:  denied  { name_bind } for  pid=20304 comm=shellinaboxd src=4200 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket

-Robin

Comment 1 Robin Powell 2012-11-29 01:19:50 UTC
Hmm.

You know, I can't help but notice that shellinabox is running as initrc_t ; that seems not great.

I have a complete shellinabox SELinux policy I made that gives it its own _exec_t, and its own transition policy, &c.  Would y'all like me to attach it here?  Or would that be a shellinabox package bug instead of an selinux bug?

-Robin

Comment 2 Robin Powell 2012-11-29 01:20:45 UTC
I ask because audit2allow says that that AVC works out to:

corenet_tcp_bind_generic_port(initrc_t)

Which, *eww*.

-Robin

Comment 3 Miroslav Grepl 2012-11-29 07:16:21 UTC
Yes, it would be fine to have attached your policy. Also is tcp/4200 used by default by shellinabox?

Comment 4 Robin Powell 2012-11-29 09:37:13 UTC
I apologize in advance; I was quite new to selinux when I did this.  It is almost certainly not minimal.  It did, however, work well for me for a long time:

http://fpaste.org/6WRZ/

WRT the port: /etc/sysconfig/shellinaboxd from the rpm has "PORT=4200", so yes.

Comment 5 Fedora End Of Life 2013-07-04 00:53:50 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 '17'.

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 17'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 17 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, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

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.

Comment 6 Robin Powell 2014-08-22 17:50:25 UTC
Here's all the AVCs that occured in non-enforcing mode when I was using shellinabox without my module (with dontaudit off), stored in a URL that won't go away:

https://gist.github.com/7b6267f10fffa2c9abfc

Sorry, that has some exim and spamd stuff in it (although those look like real issues y'all might want to fix anyway).

I suspect pretty strongly that we don't want to give init all those powers.  I had a module that had a shellinabox_d type, but I suspect it's absolute crap.  Let me know if you want it anyway.

Comment 7 Jan Kurik 2015-07-15 14:55:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

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

Comment 8 Fedora Update System 2015-08-13 08:46:10 UTC
selinux-policy-3.13.1-141.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-141.fc23

Comment 9 Fedora Update System 2015-08-15 02:10:15 UTC
Package selinux-policy-3.13.1-141.fc23:
* should fix your issue,
* was pushed to the Fedora 23 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.13.1-141.fc23'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13450/selinux-policy-3.13.1-141.fc23
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2015-08-26 04:33:52 UTC
selinux-policy-3.13.1-141.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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