grsec disallows tahoe from learning its own IP address #982
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#982
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm attempting to run Tahoe with a Linux kernel that uses grsec (2.6.32.9 with the corresponding grsec patch).
It appears that the high security mode of grsec is incompatible with Tahoe.
Grsec disallows a resource overstep when Tahoe requests 4196256 for RLIMIT_CORE. To get Tahoe started, you'll need to add the following to the init.d script:
Futhermore, it appears that Tahoe has an unhandled error when it cannont open /proc/net/dev (it's not there for normal users in high security mode). This causes Tahoe to call os.abort() and Tahoe fails to start.
It seems that Tahoe will call ifconfig and it won't work in "high" security mode.
Tahoe calls ifconfig to determine it's network location.
grsec doesn't allow /proc/net/dev for non-root users.
ifconfig complains to stderr message (as listed above), Tahoe sees this message and getmyipaddr() returns None. In addition if tub.location is not set then the node will have no location, concludes it will be unable to start up, and bails with aus.abort().
We need the following things:
I opened #1421 (increase_rlimits() tries to set RLIMIT_CORE high, which grsec disallows) to track the part about
RLIMIT_CORE
and am renaming this one to be more specifically aboutgetmyipaddr()
and/proc/net/dev
.Tahoe and grsecto grsec disallows tahoe from learning its own IP addressSo, is it the intent of someone who is running tahoe under grsec's "high" security mode that tahoe shouldn't be allowed to learn its own IP address? Or is it the intent that this would be okay for tahoe to learn its own IP address, but not okay to open
/proc/net/dev
for reading?If the former, then I agree that with ioerror's comment:76021 that tahoe should handle failure of
getmyipaddr()
(which may require manual configuration of the IP address on the part of the user, or may involve tahoe running without knowing its IP address, which it can do with potentially reduced functonality). If the latter, then we should figure out a way to learn our IP address which doesn't require such high privileges that grsec denies it.The way tahoe is currently trying to learn its IP address is by running
/sbin/ifconfig
without any elevated privileges ([soure code]source:trunk/src/allmydata/util/iputil.py?annotate=blame&rev=4971#L177). What if grsecurity allowed/sbin/ifconfig
to have read-only access to/proc/net/dev
when it (/sbin/ifconfig
) doesn't have any elevated privileges? Would that fit the intent of grsecurity users?This is more a question for grsecurity folks than Tahoe-LAFS folks, so I'll post a note to their mailing list to ask.
ndurner pointed out on IRC that http://icanhazip.com tells you the IP address that your HTTP connection is coming from. :-)
I think it's fine to learn your own IP address but not by attempting to read from /proc/ or using any tools on the system that may read from /proc or other such subsystems such as /sys.
An idea: Allow Tahoe to learn it's own likely IP address by talking to another peer or checking for a configuration option. Thus a user can manually set the tub.location or Tahoe can learn it from the introducer;
In Tor, we allow any OR to talk to another OR and ask for it's own IP address. This peer IP is often correct. The OR then attempts to connect back to test if it has incoming ports filtered or open. That may also be quite useful for Tahoe.
Thanks, ioerror!
Also last night I posted to the grsec mailing list asking about this: http://grsecurity.net/pipermail/grsecurity/2011-June/001083.html
So, why doesn't grsec provide a way for apps to learn what IP address is configured on certain interfaces without thereby giving that app any broader power that it could abuse?
Replying to ioerror:
We did something similar in Mnet. It worked well.
See #1988.
In /tahoe-lafs/trac-2024-07-25/commit/a493ee0bb641175ecf918e28fce4d25df15994b6:
Replying to ioerror:
This might be fixed on trunk; it depends on whether '
ip addr
' has the same problem as 'ifconfig
'. I don't have grsec enabled in order to test this (and don't want to enable it because I don't have time to fix anything it breaks).Note that as a side-effect of the fix to #754 (which will be released in Tahoe-LAFS 1.10.1), setting
tub.location
without including "AUTO
" will skip the local IP auto-detection code entirely, thus allowing a workaround for this problem if the other changes on trunk didn't fix it.