Skip to content

Commit f3dd35a

Browse files
committed
Minor cleanups to lfi tutorial
1 parent 99cd70c commit f3dd35a

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/chapters/alternate/lfi.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ You'll probably notice that there are only a handful of changes.
3030
- We now use `"rlbox_lfi_sandbox.hpp` instead of `rlbox_noop_sandbox.hpp`
3131
- The sandbox type which is the second parameter to the macro
3232
`RLBOX_DEFINE_BASE_TYPES_FOR` has now changed to `lfi` from `noop`
33-
- The boilerplate for `RLBOX_USE_STATIC_CALLS` has been removed as lfi backend
34-
doesn't need this
33+
- The boilerplate for `RLBOX_USE_STATIC_CALLS` has been removed as `lfi` backend
34+
doesn't need this, unlike say the [`noop`
35+
backend](/chapters/tutorial/noop-sandbox/create.md)
3536
- The lfi backend/plugin requires an extra piece of boilerplate which is to
36-
define the beginning and end of the lfi library that has been linked into the
37-
application as a datablob. This is shown as `mylib_start` and `mylib_end`
37+
define the beginning and end of the lfi library that has been embedded into
38+
the application as a datablob. This is shown as `mylib_start` and `mylib_end`
3839
here. We will discuss how to generate these variables in the next section.
3940

4041
These are mostly mechanical changes and are straightforward. Modifying the build
41-
is perhaps slightly more challenging as building wasm libraries involves
42+
is perhaps slightly more challenging as building lfi libraries involves
4243
multiple steps.
4344

4445

@@ -90,17 +91,19 @@ After we download these repos, we can then take the following steps
9091
in-sandbox runtime `libboxrt`.
9192

9293
3. Next we will create a simple assembly file that just embeds the produced lfi
93-
binary in a blob. This can be done easily with a file like
94+
binary in a datablob as part of the application. This can be done easily with
95+
a file like
9496
[this](https://github.com/UT-Security/rlbox_lfi_sandbox/blob/main/src/incstub.s)
95-
which includes the binary as a blob between two symbols
97+
which includes the binary as a datablob between two symbols
9698
`${INCSTUB_FILENAME}_start` and `${INCSTUB_FILENAME}_end`. We define
9799
`${INCSTUB_FILENAME}` to be `mylib` in our example, so we get the required
98100
`mylib_start` and `mylib_end` symbols.
99101

100-
4. Finally, we can now build our application, linking in [binary embedding
101-
file](https://github.com/UT-Security/rlbox_lfi_sandbox/blob/main/src/incstub.s),
102-
which points to our lfi binary. We also have link in the lfi-runtime's
103-
liblfi which is needed to instantiate and destroy sandboxes.
102+
4. Finally, we can now build our application, and including the file with the
103+
[datablob](https://github.com/UT-Security/rlbox_lfi_sandbox/blob/main/src/incstub.s),
104+
to embed the lfi-sandboxed library as part of the application. We also have
105+
link in the lfi-runtime's liblfi which is needed to instantiate and destroy
106+
sandboxes.
104107

105108
## Building and running the lfi backend
106109

0 commit comments

Comments
 (0)