Skip to content

Commit 133a0ff

Browse files
authored
Merge LlmpEventManager and LlmpRestartingEventManager (#2891)
* add * add 2 * feature * fix nyx launcher * a bit of doc * addressing comments
1 parent 1addbd0 commit 133a0ff

File tree

13 files changed

+520
-782
lines changed

13 files changed

+520
-782
lines changed

docs/src/message_passing/message_passing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ So the outgoing messages flow is like this over the outgoing broadcast `Shmem`:
7272
[client0] [client1] ... [clientN]
7373
```
7474

75-
To use `LLMP` in LibAFL, you usually want to use an `LlmpEventManager` or its restarting variant.
75+
To use `LLMP` in LibAFL, you usually want to use an `LlmpRestartingEventManager` or its restarting variant.
7676
They are the default if using LibAFL's `Launcher`.
7777

7878
If you should want to use `LLMP` in its raw form, without any `LibAFL` abstractions, take a look at the `llmp_test` example in [./libafl/examples](https://github.com/AFLplusplus/LibAFL/blob/main/libafl_bolts/examples/llmp_test/main.rs).

docs/src/message_passing/spawn_instances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ For more examples, you can check out `qemu_launcher` and `libfuzzer_libpng_launc
5858

5959
## Other ways
6060

61-
The `LlmpEventManager` family is the easiest way to spawn instances, but for obscure targets, you may need to come up with other solutions.
61+
The `LlmpRestartEventManager` is the easiest way to spawn instances, but for obscure targets, you may need to come up with other solutions.
6262
LLMP is even, in theory, `no_std` compatible, and even completely different EventManagers can be used for message passing.
6363
If you are in this situation, please either read through the current implementations and/or reach out to us.

fuzzers/binary_only/fuzzbench_qemu/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fuzzbench Harness
22

33
This folder contains an example fuzzer tailored for fuzzbench.
4-
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpEventManager - since fuzzbench is single threaded.
5-
Real fuzz campaigns should consider using multithreaded LlmpEventManager, see the other examples.
4+
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpRestartingEventManager - since fuzzbench is single threaded.
5+
Real fuzz campaigns should consider using multithreaded LlmpRestaringtEventManager, see the other examples.
66

77
## Build
88

fuzzers/binary_only/qemu_coverage/src/fuzzer.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ pub fn fuzz() {
288288
.monitor(MultiMonitor::new(|s| println!("{s}")))
289289
.run_client(&mut run_client)
290290
.cores(&options.cores)
291-
.stdout_file(if options.verbose {
292-
None
293-
} else {
294-
Some("/dev/null")
295-
})
296291
.build()
297292
.launch()
298293
{

fuzzers/binary_only/qemu_launcher/src/fuzzer.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use libafl::events::SimpleEventManager;
1010
#[cfg(not(feature = "simplemgr"))]
1111
use libafl::events::{EventConfig, Launcher, MonitorTypedEventManager};
1212
use libafl::{
13-
events::{ClientDescription, LlmpEventManager, LlmpRestartingEventManager},
13+
events::{ClientDescription, LlmpEventManagerBuilder},
1414
monitors::{tui::TuiMonitor, Monitor, MultiMonitor},
1515
Error,
1616
};
@@ -114,17 +114,17 @@ impl Fuzzer {
114114
// To rerun an input, instead of using a launcher, we create dummy parameters and run the client directly.
115115
return client.run(
116116
None,
117-
MonitorTypedEventManager::<_, M>::new(LlmpRestartingEventManager::new(
118-
LlmpEventManager::builder()
119-
.build_on_port(
120-
shmem_provider.clone(),
121-
broker_port,
122-
EventConfig::AlwaysUnique,
123-
None,
124-
)
125-
.unwrap(),
126-
StateRestorer::new(shmem_provider.new_shmem(0x1000).unwrap()),
127-
)),
117+
MonitorTypedEventManager::<_, M>::new(
118+
LlmpEventManagerBuilder::builder().build_on_port(
119+
shmem_provider.clone(),
120+
broker_port,
121+
EventConfig::AlwaysUnique,
122+
None,
123+
Some(StateRestorer::new(
124+
shmem_provider.new_shmem(0x1000).unwrap(),
125+
)),
126+
)?,
127+
),
128128
ClientDescription::new(0, 0, CoreId(0)),
129129
);
130130
}

fuzzers/full_system/nyx_launcher/src/fuzzer.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use std::{
77
use clap::Parser;
88
use libafl::{
99
events::{
10-
ClientDescription, EventConfig, Launcher, LlmpEventManager, LlmpRestartingEventManager,
11-
MonitorTypedEventManager,
10+
ClientDescription, EventConfig, Launcher, LlmpEventManagerBuilder, MonitorTypedEventManager,
1211
},
1312
monitors::{tui::TuiMonitor, Monitor, MultiMonitor},
1413
Error,
@@ -111,17 +110,17 @@ impl Fuzzer {
111110
// To rerun an input, instead of using a launcher, we create dummy parameters and run the client directly.
112111
return client.run(
113112
None,
114-
MonitorTypedEventManager::<_, M>::new(LlmpRestartingEventManager::new(
115-
LlmpEventManager::builder()
116-
.build_on_port(
117-
shmem_provider.clone(),
118-
broker_port,
119-
EventConfig::AlwaysUnique,
120-
None,
121-
)
122-
.unwrap(),
123-
StateRestorer::new(shmem_provider.new_shmem(0x1000).unwrap()),
124-
)),
113+
MonitorTypedEventManager::<_, M>::new(
114+
LlmpEventManagerBuilder::builder().build_on_port(
115+
shmem_provider.clone(),
116+
broker_port,
117+
EventConfig::AlwaysUnique,
118+
None,
119+
Some(StateRestorer::new(
120+
shmem_provider.new_shmem(0x1000).unwrap(),
121+
)),
122+
)?,
123+
),
125124
ClientDescription::new(0, 0, CoreId(0)),
126125
);
127126
}

fuzzers/inprocess/fuzzbench/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fuzzbench Harness
22

33
This folder contains an example fuzzer tailored for fuzzbench.
4-
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpEventManager - since fuzzbench is single threaded.
5-
Real fuzz campaigns should consider using multithreaded LlmpEventManager, see the other examples.
4+
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpRestartEventManager - since fuzzbench is single threaded.
5+
Real fuzz campaigns should consider using multithreaded LlmpRestartEventManager, see the other examples.
66

77
## Build
88

fuzzers/inprocess/fuzzbench_text/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fuzzbench Harness (text)
22

33
This folder contains an example fuzzer tailored for fuzzbench.
4-
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpEventManager - since fuzzbench is single threaded.
5-
Real fuzz campaigns should consider using multithreaded LlmpEventManager, see the other examples.
4+
It uses the best possible setting, with the exception of a SimpleRestartingEventManager instead of an LlmpRestartEventManager - since fuzzbench is single threaded.
5+
Real fuzz campaigns should consider using multithreaded LlmpRestartEventManager, see the other examples.
66

77
This fuzzer autodetect if the passed-in tokens and the initial inputs are text or binary data, and enables Grimoire in case of text.
88

0 commit comments

Comments
 (0)