![]() |
|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
![]() |
|
Thread Tools | Display Modes |
|
||||
![]()
Continued from thread: "5.7 system freeze - reproducible"
Running Torshammer against a Tor hidden service hosted locally by httpd crashes OpenBSD-5.7-stable (machine). Collecting information is tricky because it really crashes - the machine has to be shutdown by disconnecting power and the filesystems are left in a messy state. So, difficult to experiment... The good news is that it doesn't seem to be a problem with httpd. Running the slow post attack directly against httpd without going through the Tor network does not result in a crash. The system load increases but it chugs along well enough. However, when the layer 7 slow post attack is routed through the Tor network at a web site set up as a Tor hidden service, the OS freezes. (all on the same box, load is not very high - python (Torshammer), httpd, Tor, all together don't use more than 50% CPU or memory - the machine is not thrashing) I am tempted to tweak /etc/login.conf and create addition login classes for _tor and www but I'm not sure if this would help, i.e., I'm not sure how Tor is crashing the system. Actually, I'm surprised it's even possible. The daemon login class is: Code:
daemon:\ :ignorenologin:\ :datasize=infinity:\ :maxproc=infinity:\ :openfiles-cur=128:\ :stacksize-cur=8M:\ :localcipher=blowfish,9:\ :tc=default: Any ideas on how to proceed? |
|
||||
![]()
How well could the file-system be prepared to [both] survive crashes and get data onto the disk right up to the crash point (or near enough (hopefully))?
The system could potentially be instrumented and, while recording, the crash could be induced (it's *very* reproducible, like an OpenBSD remote kill button (bzzzt - dead)). |
|
||||
![]()
And, while removing softdep as an option -- which makes metadata updates synchronous, add the sync option. This will force writes of file data to be performed synchronously, also.
Yes, disk performance will then be very slow. But this should result in fewer sectors pending in RAM at the point when the system ceases to function. |
|
||||
![]()
Same behavior with Tor version 0.2.6.10 - a layer 7 slow post attack results in a kernel hang within a minute or two of the beginning of the attack. Has anyone tried (successfully or otherwise) to duplicate this behavior?
I could be off here but it seems like there might be people in the world whose lifestyle, livelihood, or life might depend on this (Tor) software. Since OpenBSD is tauted as a security centric OS, some people might select it for their privacy critical servers. If there isn't something peculiar about my particular setup, if Tor+OpenBSD is vulnerable to this attack then I guess the alarms should sound so people can protect themselves. I'll probably keep tinkering with it but my setup has limitations. If anyone out there makes an attempt to test Tor+OpenBSD under a Torshammer attack, I would really like to hear about it! |
|
|||
![]()
You might have more luck on the tor-bsd list: tor-bsd@lists.nycbug.org
At least there I know there are people that do use tor heavily on OpenBSD. |
|
||||
![]()
Good news, I don't think the kernel hang is due to Tor (or httpd).
I borrowed a laptop from a friend and booted Tails from a USB flash drive then ran the Torshammer attack against the Tor hidden service running on the OpenBSD machine. No crash! System load stayed below 10% and it even continued to serve pages, albeit, with some lag. My current guess is the wpi firmware, under the load of the Tor/hidden-service + Tor/spDoS traffic is what caused the kernel to hang. |
|
||||
![]()
Don't guess. Do a root cause analysis.
Are you able to enter ddb? If so, you can backtrace to determine what the kernel is busy doing. If not ... did you turn off softdep, turn on sync, set up a console with a slew of tmux windows logging (see the tmux pipe-pane option, there's an example in the portslogger(8) man page) and recreate the problem? One common cause for a "hung system" is running out of swap space. If a userland process cannot allocate memory, the process will fail. But, if the kernel cannot allocate memory, the OS will not continue to function. |
|
||||
![]() Quote:
I had a go at Tmux Logging and the Tmux Plugin Manager in an attempt to generate nice data from top and systat reports, but the log files were too ugly to deal with (not simple ascii). So, to move forward with the data collection process I just used vmstat and iostat and piped their outputs to files; launched Torshammer; the kernel hang occurred as expected; then power cycled the machine but it wouldn't get past: acpi0: sleep states S0 S3 S4 S5 Since this is my Internet gateway machine, I am becoming a bit gun-shy about the 'let it crash' method of experimentation. |
|
||||
![]()
In your other thread, I'd recommended this misc@ discussion regarding httpd hangs. The group testing and debugging included a user who proposed a patch to TLS handling in httpd(8), which was accepted with minor differences. That patch was committed to -current yesterday, though the problem reported affected -stable also.
I don't know if your system under test includes HTTPS, which uses TLS. If it does, this fix may produce different results for you. There was also a -stable commit for improper handling of 0-byte TCP packets on the 13th. You'd posted a dmesg of a -stable kernel built on the 10th. If your system under test need to manage 0-byte TCP packets, this fix may produce different results for you. --- I don't know if either of these would have any impact. As with most problems, there's more about them I don't know than I do. ![]() Last edited by jggimi; 16th July 2015 at 11:12 AM. Reason: corrected first link |
|
||||
![]()
Scenario 1 - kernel hangs
![]() Scenario 2 - system chugs along ![]() Scenario 3 - system chugs along ![]() My current guess is the kernel hang is due to issues in the wpi driver and/or firmware when under heavy load of this type. A simple way to test that guess is to recreate Scenario 1 on a machine with a different NIC. Unfortunately, I'm not suitably equipped (hardware) to run that test but I would happily talk someone through it... |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenBSD: Comparing Errata and -Stable | jggimi | Guides | 4 | 6th June 2012 06:28 AM |
-stable snapshots "openbsd-stable.org" (?) | dnix | OpenBSD Installation and Upgrading | 9 | 18th December 2011 12:48 PM |
Noob: Updating To OpenBSD-Stable. | MetalHead | OpenBSD Installation and Upgrading | 3 | 11th November 2008 02:06 AM |
How to Fix Security Issue In OpenBSD 4.1 Stable ? | openbsdspirit | OpenBSD General | 4 | 21st June 2008 11:33 AM |
OpenBSD -STABLE | BSDfan666 | OpenBSD General | 6 | 21st May 2008 10:10 PM |