Skip to content

Commit b2e2b9f

Browse files
committed
kernelCTF: GHA: add mitigation-v3b release without nftables
1 parent c6972fc commit b2e2b9f

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

kernelctf/build_release.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ case $TARGET in
2929
mitigation)
3030
REPO="https://github.com/thejh/linux"
3131
case $VERSION in
32-
v3-6.1.55)
32+
v3-* | v3b-*)
3333
DEFAULT_BRANCH="mitigations-next"
34-
CONFIG_FN="mitigation-v3.config"
34+
case $VERSION in
35+
v3-6.1.55) CONFIG_FN="mitigation-v3.config" ;;
36+
v3b-6.1.55) CONFIG_FN="mitigation-v3b.config" ;;
37+
esac
3538
CONFIG_FULL_FN="mitigation-v3-full.config"
3639
;;
3740
6.1 | 6.1-v2)
@@ -57,6 +60,17 @@ CONFIGS_DIR="$BASEDIR/kernel_configs"
5760

5861
if [ -d "$RELEASE_DIR" ]; then echo "Release directory already exists. Stopping."; exit 1; fi
5962

63+
echo "GCC version"
64+
echo "================="
65+
gcc --version || true
66+
echo
67+
68+
echo "Clang version"
69+
echo "================="
70+
clang --version || true
71+
echo "================="
72+
echo
73+
6074
mkdir -p $BUILD_DIR 2>/dev/null || true
6175
cd $BUILD_DIR
6276
if [ ! -d ".git" ]; then git init && git remote add origin $REPO; fi

kernelctf/get_latest_kernel_versions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def add_release(release_id, branch=None):
1717
global releases
1818
releases.append({ "releaseId": release_id, "branch": branch })
1919

20-
for lts_version in ["6.1", "6.6"]:
20+
for lts_version in ["6.6"]:
2121
latest_lts = run(f"git ls-remote --tags --sort='-v:refname' https://github.com/gregkh/linux 'v{lts_version}.*[0-9]'")[0].split("refs/tags/")[1]
2222
print(f"Latest LTS {lts_version}: {latest_lts}")
2323
add_release(f"lts-{latest_lts[1:]}")
2424

25-
for cos_milestone in [97, 105, 109]:
25+
for cos_milestone in [105, 109]:
2626
release_notes = fetch(f"https://cloud.google.com/feeds/cos-{cos_milestone}-release-notes.xml")
2727
tree = etree.XML(release_notes.encode('utf-8'))
2828
entries = tree.xpath("//*[local-name() = 'content']/text()")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CONFIG_IO_URING is not set
2+
CONFIG_SYSTEM_TRUSTED_KEYS=""
3+
4+
## required by CONFIG_KMALLOC_SPLIT_VARSIZE
5+
# CONFIG_SLAB_MERGE_DEFAULT is not set
6+
7+
## turns on our mitigations
8+
CONFIG_KMALLOC_SPLIT_VARSIZE=y
9+
CONFIG_SLAB_VIRTUAL=y
10+
11+
## turns on CONFIG_RANDOM_KMALLOC_CACHES
12+
CONFIG_RANDOM_KMALLOC_CACHES=y
13+
14+
## turns on additional hardenings
15+
CONFIG_BUG_ON_DATA_CORRUPTION=y
16+
CONFIG_FORTIFY_SOURCE=y
17+
CONFIG_DEBUG_WX=y
18+
CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
19+
# CONFIG_FUSE_FS is not set
20+
21+
### Make the kernel less annoying to debug
22+
## Compile the kernel with debug info
23+
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
24+
# Have all symbols in kallsyms
25+
CONFIG_KALLSYMS_ALL=y
26+
27+
# CONFIG_NF_TABLES is not set

kernelctf/server/server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_releases():
4949
del releases[release_id]
5050
continue
5151

52-
m = re.match(r'(?P<target>lts|mitigation(-v3)?|cos-\d+)-(?P<version>\d+(\.\d+)+)', release_id)
52+
m = re.match(r'(?P<target>lts|mitigation(-v3|-v3b)?|cos-\d+)-(?P<version>\d+(\.\d+)+)', release_id)
5353
if m is None:
5454
warning(f'release {release_id} does not match regex')
5555
del releases[release_id]
@@ -102,7 +102,7 @@ def print_filtered(name, status_filter):
102102
print_filtered('Deprecated targets', 'deprecated')
103103
else:
104104
print_filtered('Current targets', 'latest')
105-
print_filtered('Future targets', 'future')
105+
print_filtered('Future targets', 'future')
106106

107107
def are_you_sure(prompt):
108108
print(prompt)

0 commit comments

Comments
 (0)