View pkru.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <sys/mman.h> | |
static uint32_t rdpkru(void) | |
{ | |
uint32_t ecx = 0; | |
uint32_t edx, pkru; |
View repro.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <sys/mman.h> | |
#define BITS_PER_PKEY 2 | |
static uint32_t rdpkru(void) | |
{ | |
uint32_t ecx = 0; |
View accounting_underflow.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sys/mman.h> | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#ifndef MREMAP_DONTUNMAP |
View userfaultfd_read_block.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> |
View userfaultfd_close.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> |
View controlflow.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <memory> | |
#include <cstdio> | |
void* _saved_return; | |
void* _saved_bp; | |
#define NO_INLINE __attribute__((noinline)) | |
#define SET_OLD_RBP() \ |
View defer.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <memory> | |
#define GET_RETURN_VALUE64(VAR) \ | |
asm ("nop\n nop\n movq %%rax,%0 \n nop\n" \ | |
: "=r" (VAR) \ | |
: \ | |
: "rax" \ | |
); |
View userfaultfd_race.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> |
View fizzbuzz.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* fizzbuzz.cpp | |
* | |
* Created on: Apr 25, 2012 | |
* Author: Brian Geffon | |
* | |
* fizzbuzz solved without looping or conditionals using only template recursion. | |
*/ | |
#include <iostream> |