Skip to content

Commit 05009e4

Browse files
committed
Document that Mio report OOB data in Event::is_readable
Reporting Out-of-band (OOB) as readable it could leave applications open to DoS attacks. However because Mio uses edge-triggers most applications won't actually be effected.
1 parent 44666e8 commit 05009e4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/event/event.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ impl Event {
2525
}
2626

2727
/// Returns true if the event contains readable readiness.
28+
///
29+
/// # Notes
30+
///
31+
/// Out-of-band (OOB) data also triggers readable events. But must
32+
/// application don't actually read OOB data, this could leave an
33+
/// application open to a Denial-of-Service (Dos) attack, see
34+
/// <https://github.com/sandstorm-io/sandstorm-website/blob/58f93346028c0576e8147627667328eaaf4be9fa/_posts/2015-04-08-osx-security-bug.md>.
35+
/// However because Mio uses edge-triggers it will not result in an infinite
36+
/// loop as described in the article above.
2837
pub fn is_readable(&self) -> bool {
2938
sys::event::is_readable(&self.inner)
3039
}

0 commit comments

Comments
 (0)