Skip to content

Instantly share code, notes, and snippets.

View dvdhrm's full-sized avatar
✔️
Fixing Whitespace, what else would you do at this time?

David Rheinsberg dvdhrm

✔️
Fixing Whitespace, what else would you do at this time?
View GitHub Profile
@dvdhrm
dvdhrm / memfd.patch
Created February 28, 2014 18:20
memfd_create() syscall
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 96bc506..c943b8a 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -359,3 +359,4 @@
350 i386 finit_module sys_finit_module
351 i386 sched_setattr sys_sched_setattr
352 i386 sched_getattr sys_sched_getattr
+353 i386 memfd_create sys_memfd_create
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
┏┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┳┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┏┓┳┏┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┳┳┓┳┳┳┳┳┏┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┓
┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┳╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓╋╋╋╋╋┣╋╋╋╋╋┳┳┳┳┳╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╻╋╋╻╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┳╋╋╋┫
┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋┻╋╋╋┻┻┛╋╋╋╋╋┏┓╋╋╋╋╋╋╋┗╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┳╋╋┳┓╋╋╋┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓╋┣╋┳┳┓╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┳┳┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋┻╋┫
┣╋╋╋╋╋╋╋╋╋╋╋┏┳┓╋╺┳┓╋┣╋┛╋┣╋┫╋╋╋╋╋╻╋┏╋┫╋╋╋╋╋╋╋╋┣╋┻╋┓╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋╋╋╋┛╋┏┳╋╋╋╋╋╋┻┻┻┻╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┳╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋╋┫╋╋╋╋╋╋╋╋┏┳┓╋╋╋╋┏┳┓╋╋╋╋╋╋╋╋╋╋┗┻┛╋┣┫
┣╋╋╋╋╋╋╋╋╋┏┳╋╋┫╋╋┗╋┳╋┫╋╋┣╋┫╋╋╋╋┏╋┳╋╋╋┳┓╋╋╋╋╋╺╋┫╋┗┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋┫╋╋┣╋╋┻╋╋╋┫╋╋╋╋┗╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋╋╋┓╋╋╋╋╋╋╋┗╋╋┓╋╋╋┣╋┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┫
┣╋╋╋╋╋╋╋╋╋┣╋╋╋╋┓╋╋┣╋╋╋┳┳╋╋╋┳┓╋╋┗╋╋╋╋╋╋┛╋╋╋╋╋╋┗┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┻┻┫╋╺┻┻┛╋┣╋╋┫╋╋╋╋╋┗┻┛╋╋╋╋╋╋╋┏┓╋┏┓╋╋╋╋╋╋╋╋╋╋┣╋┻╋┓╋╋╋┏┓╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗┻╋╋┻┛╋╋╋╋╋╋┻┻┗┻┻━┳┳
┏┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┳┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┏┓┳┏┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┳┳┓┳┳┳┳┳┏┳┳┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┓┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┳┏┳┳┓
┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┳╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓╋╋╋╋╋┣╋╋╋╋╋┳┳┳┳┳╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╻╋╋╻╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┳╋╋╋┫
┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋┻╋╋╋┻┻┛╋╋╋╋╋┏┓╋╋╋╋╋╋╋┗╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┳╋╋┳┓╋╋╋┣╋╋╋╋╋╋╋╋╋╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓╋┣╋┳┳┓╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┳┳┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋┻╋┫
┣╋╋╋╋╋╋╋╋╋╋╋┏┳┓╋╺┳┓╋┣╋┛╋┣╋┫╋╋╋╋╋╻╋┏╋┫╋╋╋╋╋╋╋╋┣╋┻╋┓╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋╋╋╋┛╋┏┳╋╋╋╋╋╋┻┻┻┻╋╋╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋┳╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏╋╋╋┫╋╋╋╋╋╋╋╋┏┳┓╋╋╋╋┏┳┓╋╋╋╋╋╋╋╋╋╋┗┻┛╋┣┫
┣╋╋╋╋╋╋╋╋╋┏┳╋╋┫╋╋┗╋┳╋┫╋╋┣╋┫╋╋╋╋┏╋┳╋╋╋┳┓╋╋╋╋╋╺╋┫╋┗┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋┫╋╋┣╋╋┻╋╋╋┫╋╋╋╋┗╋╋╋┻┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗╋╋╋┫╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣╋╋╋╋┓╋╋╋╋╋╋╋┗╋╋┓╋╋╋┣╋┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┫
┣╋╋╋╋╋╋╋╋╋┣╋╋╋╋┓╋╋┣╋╋╋┳┳╋╋╋┳┓╋╋┗╋╋╋╋╋╋┛╋╋╋╋╋╋┗┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┣┻┻┫╋╺┻┻┛╋┣╋╋┫╋╋╋╋╋┗┻┛╋╋╋╋╋╋╋┏┓╋┏┓╋╋╋╋╋╋╋╋╋╋┣╋┻╋┓╋╋╋┏┓╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗┻╋╋┻┛╋╋╋╋╋╋┻┻┗┻┻━┳┳
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 53b6568..d4e0db3 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc/kdbus/connection.c
@@ -132,6 +132,7 @@ static struct kdbus_conn *kdbus_conn_new(struct kdbus_ep *ep, bool privileged,
conn->cred = get_current_cred();
conn->user_ns = get_user_ns(current_user_ns());
conn->pid_ns = get_pid_ns(task_active_pid_ns(current));
+ conn->pid = get_pid(task_pid(current));
get_fs_root(current->fs, &conn->root_path);
@dvdhrm
dvdhrm / hello-world.rs
Created December 5, 2018 10:36
UEFI Hello World in Rust
//
// Example: Hello World!
//
// This is an example UEFI application that prints "Hello World!", then waits for key input before
// it exits. It serves as base example how to write UEFI applications without any helper modules
// other than the UEFI protocol definitions.
//
// The `efi_main` function serves as entry-point. Depending on your target-configuration, this
// entry point might be called differently. If you use the target-configuration shipped with
// r-efi, then `efi_main` is the selected PE/COFF entry point.
[2020-07-16T11:19:11.452Z] ------------------------------------------------------------------------------
[2020-07-16T11:19:11.452Z] 🏃🏻 Running test: rhel_8-x86_64-tar-boot.json
[2020-07-16T11:19:11.452Z] ------------------------------------------------------------------------------
[2020-07-16T11:19:11.452Z] === RUN TestImages
[2020-07-16T11:19:11.452Z] === RUN TestImages/rhel_8-x86_64-tar-boot.json
From 2b56e5b196db37697d9e678eacc1c351a0f5f67a Mon Sep 17 00:00:00 2001
From: David Rheinsberg <david.rheinsberg@gmail.com>
Date: Tue, 23 Jun 2020 18:54:47 +0200
Subject: [PATCH] WIP
---
Makefile | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/Makefile b/Makefile
@dvdhrm
dvdhrm / makefile.diff
Created June 23, 2020 10:28
Coverity for OSBuild
diff --git a/Makefile b/Makefile
index fcc5317..a2b63d9 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,11 @@
BUILDDIR ?= .
SRCDIR ?= .
+MKDIR ?= mkdir
PYTHON3 ?= python3
@dvdhrm
dvdhrm / kmstest.c
Created November 14, 2011 20:11
DRM KMS Test
#define EGL_EGLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <errno.h>
#include <gbm.h>
#include <GL/gl.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <stdlib.h>
method return time=1580904255.908957 sender=org.freedesktop.DBus -> destination=:1.109 serial=4294967295 reply_serial=2
array [
dict entry(
string "org.bus1.DBus.Debug.Stats.PeerAccounting"
variant array [
struct {
string ":1.0"
array [
dict entry(
string "UnixUserID"