Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump versions #141

Conversation

endersonmaia
Copy link
Contributor

Since Ubuntu released oficial ricvs64 container images for 24.04, I suggest bumping its versions.

Also bumped cartesi/sdk and golang.

I just built but didn't test if everything worked.

Copy link

vercel bot commented Aug 22, 2024

@endersonmaia is attempting to deploy a commit to the Bug Buster App Team on Vercel.

A member of the Team first needs to authorize it.

@endersonmaia endersonmaia self-assigned this Aug 22, 2024
@endersonmaia
Copy link
Contributor Author

I'm considering sending a PR with a distroless version using Canonical's chisel tool.

It should be good to have a smaller image, it may reduce the attack surface.

@guidanoli
Copy link
Contributor

Maybe we should also bump Ubuntu in the following files:

tests/bounties/busybox-bounty/Dockerfile
tests/bounties/lua-bounty/Dockerfile
tests/bounties/solidity-bounty/Dockerfile
tests/bounties/sqlite-bounty/Dockerfile

@guidanoli
Copy link
Contributor

I'm considering sending a PR with a distroless version using Canonical's chisel tool.

Could you open an issue for it, please?

@endersonmaia
Copy link
Contributor Author

About reproducibility, should I try to add locked versions to debian packages within this PR or use another one?

@guidanoli
Copy link
Contributor

About reproducibility, should I try to add locked versions to debian packages within this PR or use another one?

Yeah, I think it would be nice to work towards having reproducible builds.
If you want to do it in this PR, or on another, it's totally up to you, though! :-)

@endersonmaia endersonmaia changed the base branch from main to next September 2, 2024 19:34
@endersonmaia endersonmaia force-pushed the feature/bump-ubuntu-and-go-versions branch from f427515 to c58426b Compare September 2, 2024 19:59
@guidanoli
Copy link
Contributor

I ran the tests, and, for some reason, now the BusyBox exploit is not working...
Instead of segfaulting, it now prints the following error message:

ash: arithmetic syntax error

Any insights, @edubart?

@endersonmaia endersonmaia force-pushed the feature/bump-ubuntu-and-go-versions branch from c58426b to 0c9315a Compare September 3, 2024 11:53
@endersonmaia
Copy link
Contributor Author

Starting with ubuntu:24.04 we can use apt update --snapshot= to guarantee we don't download any "new" package and make the build reproducible.

See: https://snapshot.ubuntu.com/

This way we can avoid pining the package versions, and focus on the --snapshot.

I'll send fixups.

@endersonmaia endersonmaia force-pushed the feature/bump-ubuntu-and-go-versions branch from 9dc73d8 to de36e8b Compare September 3, 2024 19:02
@endersonmaia
Copy link
Contributor Author

apt update --snapshot wasn´t working due to certificate errors.

I removed the commit where I introduced it, rebased and squashed.

@endersonmaia endersonmaia force-pushed the feature/bump-ubuntu-and-go-versions branch from de36e8b to f2420c7 Compare September 3, 2024 19:06
@guidanoli
Copy link
Contributor

apt update --snapshot wasn't working due to certificate errors.

That's a shame!

@endersonmaia
Copy link
Contributor Author

apt update --snapshot wasn't working due to certificate errors.

That's a shame!

I may go back to that on another PR.

tests/Dockerfile Outdated
Comment on lines 4 to 8
RUN apt-get install -y \
build-essential \
git \
lua5.4-dev \
luarocks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not fix these versions as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sent a fixup at c41fcc6

@guidanoli
Copy link
Contributor

Here is the patch that makes the BusyBox exploit still valid.
I've tested locally and seems to work.
Thanks for the help, @edubart!

diff --git a/tests/bounties/busybox-bounty/Makefile b/tests/bounties/busybox-bounty/Makefile
index 790ee66..8fc373d 100644
--- a/tests/bounties/busybox-bounty/Makefile
+++ b/tests/bounties/busybox-bounty/Makefile
@@ -5,7 +5,7 @@ SOURCE_DIR=busybox-$(VERSION)
 BOUNTY_TAR=busybox-$(VERSION)-bounty_$(ARCH).tar.xz
 BOUNTY_RISCV64_TAR=busybox-$(VERSION)-bounty_riscv64.tar.xz
 
-HARDEN_CFLAGS=-Os -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections -Wno-unused-result
+HARDEN_CFLAGS=-O1 -ftrivial-auto-var-init=pattern -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections -Wno-unused-result
 HARDEN_LDFLAGS=-pie -Wl,-z,now,-z,relro,--gc-sections -s
 
 # Use GitHub Actions cache when available
diff --git a/tests/bounties/lua-bounty/Makefile b/tests/bounties/lua-bounty/Makefile
index 49708a5..9898efb 100644
--- a/tests/bounties/lua-bounty/Makefile
+++ b/tests/bounties/lua-bounty/Makefile
@@ -5,7 +5,7 @@ SOURCE_DIR=lua-$(VERSION)
 BOUNTY_TAR=lua-$(VERSION)-bounty_$(ARCH).tar.xz
 BOUNTY_RISCV64_TAR=lua-$(VERSION)-bounty_riscv64.tar.xz
 
-HARDEN_CFLAGS=-Os -D_FORTIFY_SOURCE=2 -fexceptions -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections
+HARDEN_CFLAGS=-O1 -ftrivial-auto-var-init=pattern -D_FORTIFY_SOURCE=2 -fexceptions -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections
 HARDEN_LDFLAGS=-pie -Wl,-z,now,-z,relro,--gc-sections -s
 
 # Use GitHub Actions cache when available
diff --git a/tests/bounties/solidity-bounty/Dockerfile b/tests/bounties/solidity-bounty/Dockerfile
index 4e78a40..e6a5407 100644
--- a/tests/bounties/solidity-bounty/Dockerfile
+++ b/tests/bounties/solidity-bounty/Dockerfile
@@ -36,6 +36,8 @@ ARG VERSION
 RUN wget -O solidity-${VERSION}.tar.gz https://github.com/ethereum/solidity/releases/download/v${VERSION}/solidity_${VERSION}.tar.gz
 RUN tar xzf solidity-${VERSION}.tar.gz
 COPY --from=boost-builder /opt/boost /opt/boost
+ENV CFLAGS="-O1 -ftrivial-auto-var-init=pattern -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections -Wno-unused-result"
+ENV CXXFLAGS=$CFLAGS
 RUN cmake \
     -S solidity_${VERSION} \
     -B solidity_${VERSION}/build \
diff --git a/tests/bounties/sqlite-bounty/Makefile b/tests/bounties/sqlite-bounty/Makefile
index 3e44e1b..cd86918 100644
--- a/tests/bounties/sqlite-bounty/Makefile
+++ b/tests/bounties/sqlite-bounty/Makefile
@@ -6,7 +6,7 @@ BOUNTY_TAR=sqlite-$(VERSION)-bounty_$(ARCH).tar.xz
 BOUNTY_RISCV64_TAR=sqlite-$(VERSION)-bounty_riscv64.tar.xz
 
 CC=gcc
-HARDEN_CFLAGS=-Os -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections
+HARDEN_CFLAGS=-O1 -ftrivial-auto-var-init=pattern -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections
 HARDEN_LDFLAGS=-pie -Wl,-z,now,-z,relro,--gc-sections
 SQLITE_CFLAGS=-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
 SQLITE_LDFLAGS=-lm -s

@guidanoli
Copy link
Contributor

Can you rebase, to trigger the new CI on PRs?

endersonmaia and others added 6 commits September 5, 2024 10:54
- lock baseimage to ubuntu:noble-20240801
- avoid using apt upgrade -y
- lock version of all packages installed via apt

It's not guaranteed since apt update will bring the current state of the
remote mirror used and because of that the dependecies for the installed
packages can change between runs.
@endersonmaia endersonmaia force-pushed the feature/bump-ubuntu-and-go-versions branch from 07e8838 to dff60e9 Compare September 5, 2024 13:54
@guidanoli
Copy link
Contributor

guidanoli commented Sep 6, 2024

I think the CI is failing because you opened a PR from your fork under endersonmaia, and it's not able to push the images to GHCR under crypto-bug-hunters, even with pr- tags. Could you push your branch to crypto-bug-hunters/bug-buster, and update this PR to use that?

@endersonmaia
Copy link
Contributor Author

endersonmaia commented Sep 6, 2024

I think the CI is failing because you opened a PR from your fork under endersonmaia, and it's not able to push the images to GHCR under crypto-bug-hunters, even with pr- tags. Could you push your branch to crypto-bug-hunters/bug-buster, and update this PR to use that?

I'll need to create another PR.

@endersonmaia
Copy link
Contributor Author

Replaced by #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants