10
10
type : number
11
11
shaHash :
12
12
description : ' SHA hash'
13
+ skipRepro :
14
+ description : ' Skip reproduction'
15
+ type : boolean
16
+ required : false
17
+ default : false
13
18
permissions : {}
14
19
env :
15
20
PR_REF : ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.shaHash || format('refs/pull/{0}/merge', github.event.inputs.prNumber)) || github.event.pull_request.head.sha }}
@@ -104,6 +109,49 @@ jobs:
104
109
if : failure() && steps.build_exploit.outcome == 'failure'
105
110
run : printf '❌ The exploit compilation failed.\n\nPlease fix it.\n\nYou can see the build logs by clicking on `...` here and then on "View job logs". Or by selecting `exploit_build (${{ env.RELEASE_ID }})` under Jobs in the left menubar.\n' >> $GITHUB_STEP_SUMMARY
106
111
112
+ exploit_build_debug :
113
+ runs-on : ubuntu-latest
114
+ needs : structure_check
115
+ permissions : {}
116
+ strategy :
117
+ matrix :
118
+ target : ${{ fromJSON(needs.structure_check.outputs.targets) }}
119
+ fail-fast : false # do not cancel other targets
120
+ env :
121
+ RELEASE_ID : ${{ matrix.target }}
122
+ EXPLOIT_DIR : pr/pocs/linux/kernelctf/${{ needs.structure_check.outputs.submission_dir }}/exploit/${{ matrix.target }}
123
+ steps :
124
+ - name : Checkout PR content
125
+ uses : actions/checkout@v4
126
+ with :
127
+ path : pr
128
+ ref : ${{ env.PR_REF }}
129
+ fetch-depth : 0
130
+
131
+ - name : Convert exploit to debug build
132
+ working-directory : ${{ env.EXPLOIT_DIR }}
133
+ run : |
134
+ sed -i '/gcc -g/!s/gcc/gcc -g/g' Makefile
135
+ sed -i '/configure --enable-debug/!s/configure/configure --enable-debug/g' Makefile
136
+ sed -i 's/-o exploit /-o exploit_debug /g' Makefile
137
+ sed -i 's/ -s\b//g' Makefile
138
+ sed -i 's/exploit:/exploit_debug:/g' Makefile
139
+
140
+ - name : Build exploit
141
+ working-directory : ${{ env.EXPLOIT_DIR }}
142
+ run : |
143
+ if make -n prerequisites; then
144
+ make prerequisites
145
+ fi
146
+ make exploit_debug
147
+
148
+ - name : Upload debug build
149
+ uses : actions/upload-artifact@v4
150
+ with :
151
+ name : exploit_debug_${{ env.RELEASE_ID }}
152
+ path : ${{ env.EXPLOIT_DIR }}/exploit_debug
153
+ if-no-files-found : error
154
+
107
155
exploit_repro :
108
156
runs-on : ubuntu-latest
109
157
timeout-minutes : 300
@@ -113,7 +161,7 @@ jobs:
113
161
matrix :
114
162
target : ${{ fromJSON(needs.structure_check.outputs.targets) }}
115
163
fail-fast : false
116
- if : always() && needs.structure_check.result == 'success'
164
+ if : always() && needs.structure_check.result == 'success' && !inputs.skipRepro
117
165
env :
118
166
RELEASE_ID : ${{ matrix.target }}
119
167
SUBMISSION_DIR : ${{ needs.structure_check.outputs.submission_dir }}
@@ -228,7 +276,7 @@ jobs:
228
276
229
277
backup_artifacts :
230
278
runs-on : ubuntu-latest
231
- needs : [structure_check, exploit_build, exploit_repro]
279
+ needs : [structure_check, exploit_build, exploit_build_debug, exploit_repro]
232
280
if : always() && needs.structure_check.result == 'success'
233
281
steps :
234
282
- name : Download artifacts
0 commit comments