Skip to content

Instantly share code, notes, and snippets.

View mbs0221's full-sized avatar
🏠
Working

Benshan Mei mbs0221

🏠
Working
View GitHub Profile
@dayeol
dayeol / Fall2020Projects.md
Created September 2, 2020 18:56
Fall 2020 Research Projects

Research Projects

Preventing Iago attacks on Keystone

Iago attack uses an attacker's ability of choosing return value of a procedure call, especially system calls. If the attacker is somehow proxying the procedure, and/or can inject arbitrary return value, she can use this to break confidentiality or integrity of the program. One example is getpid() in Apache. Apache uses the return value of getpid() system call to get non-repeating nonce for its child process. However, if the attacker can choose the return value, it means that she can choose an arbitrary nonce.

The original scenario introduced by the paper was based on a network adversary during remote procedure call (RPC).

@dominiksalvet
dominiksalvet / riscv-extensions.md
Last active January 14, 2026 16:50
A list of RISC-V standard extensions

RISC-V Extensions

Base Description
RV32E Base 32-bit ISA with 16 registers
RV32I Base 32-bit ISA
RV64I Base 64-bit ISA
RV128I Base 128-bit ISA

| Extension | Description |

@mayanez
mayanez / pptx2pdf-annotate.py
Created May 9, 2020 00:14
pptx2pdf-annotate
"""
Adds PPTX Presenter Notes as PDF Text Annotations.
This can then be used with `pdfpc` (https://github.com/pdfpc/pdfpc) for presentations.
NOTE:
<input.pptx> and <input.pdf> must contain the same number of pages.
"""
import sys
from pptx import Presentation
@nrdmn
nrdmn / vsock-notes.md
Last active February 3, 2026 19:04
vsock notes

vsock notes

about vsocks

Vsocks are a means of providing socket communication (either stream or datagram) directly between VMs and their host operating system. The host and each VM have a 32 bit CID (Context IDentifier) and may connect or bind to a 32 bit port number. Ports < 1024 are privileged ports.

@siddontang
siddontang / BPF.txt
Last active July 19, 2023 08:21
BPF Performance Tools
Hello BPF
@JimChengLin
JimChengLin / tsx.cpp
Last active September 5, 2023 16:36
Intel TSX simple benchmark
#include <atomic>
#include <chrono>
#include <immintrin.h>
#include <iostream>
#include <thread>
struct Node {
Node * prev{};
Node * next{};
};
@lizrice
lizrice / hello_map.py
Last active July 19, 2023 08:20
eBPF hello world
#!/usr/bin/python
from bcc import BPF
from time import sleep
# This outputs a count of how many times the clone and execve syscalls have been made
# showing the use of an eBPF map (called syscall).
program = """
BPF_HASH(syscall);
using System;
using System.Runtime.InteropServices;
using static LowSharp;
namespace LLVM
{
#region Enums
//LLVMVerifierFailureAction
public enum LLVMVerifierFailureAction : Int32
{
@ukyo
ukyo / index.html
Last active December 8, 2025 03:23
WebAssembly Shared Memory example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
>
<meta
#include <linux/module.h>
static inline uint64_t exec_rdmsr(uint64_t msr)
{
uint32_t low, high;
asm volatile (
"rdmsr"
: "=a"(low), "=d"(high)
: "c"(msr)
);