Skip to content

Commit

Permalink
Document that Mio report OOB data in Event::is_readable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Thomasdezeeuw committed Nov 6, 2021
1 parent 44666e8 commit 05009e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/event/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ impl Event {
}

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

0 comments on commit 05009e4

Please sign in to comment.