Skip to content

Instantly share code, notes, and snippets.

Avatar

Sargun Dhillon sargun

  • Netflix
  • United States
View GitHub Profile
View gist:f0f83f66eef152fcc82f457729cef5f0
* gentoo-functions-0.14.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
Unable to unshare: EPERM (for FEATURES="pid-sandbox")
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Unpacking source...
>>> Unpacking gentoo-functions-0.14.tar.gz to /titus/linux/tmp/var/tmp/portage/sys-apps/gentoo-functions-0.14/work
>>> Source unpacked in /titus/linux/tmp/var/tmp/portage/sys-apps/gentoo-functions-0.14/work
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Preparing source in /titus/linux/tmp/var/tmp/portage/sys-apps/gentoo-functions-0.14/work/gentoo-functions-0.14 ...
>>> Source prepared.
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
View trusted_tpm1.c
/* Linux Kernel v5.10
* security/keys/trusted-keys/trusted_tpm1.c#L387
*/
static int pcrlock(const int pcrnum)
{
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return tpm_pcr_extend(chip, pcrnum, digests) ? -EINVAL : 0;
}
View foo.c
/*
* Excerpt from trusted_tpm1.c
* https://elixir.bootlin.com/linux/latest/source/security/keys/trusted-keys/trusted_tpm1.c#L387
*/
static int pcrlock(const int pcrnum)
{
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return tpm_pcr_extend(chip, pcrnum, digests) ? -EINVAL : 0;
View gist:5c7f2898fd358d7dfb50c5a21b776e4e
/*
* Excerpt from trusted_tpm1.c
* https://elixir.bootlin.com/linux/latest/source/security/keys/trusted-keys/trusted_tpm1.c#L387
*/
static int pcrlock(const int pcrnum)
{
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return tpm_pcr_extend(chip, pcrnum, digests) ? -EINVAL : 0;
View destructor.py
#!/usr/bin/env python3
import os, random, time, sys, mmap, random
fds = []
mmaps = []
SIZE = (2**20)
def rand_str():
return bytes(chr(random.randint(0, 127)) * SIZE, 'ascii')
View gist:29c6de23168008059bc1c01e3f34c904
root@ubuntu:/sys/kernel/debug/tracing# echo 1 > options/func_stack_trace
root@ubuntu:/sys/kernel/debug/tracing# echo call_fib_notifiers >> set_ftrace_filter
root@ubuntu:/sys/kernel/debug/tracing# echo function > current_tracer
# Not sure if this one actually does anything....
root@ubuntu:/sys/kernel/debug/tracing# echo stacktrace > trace_options
root@ubuntu:/sys/kernel/debug/tracing# echo 1 > options/record-cmd
root@ubuntu:/sys/kernel/debug/tracing# echo userstacktrace > trace_options
root@ubuntu:/sys/kernel/debug/tracing# cat trace_pipe
ip-2678 [001] .... 1651.037870: call_fib_notifiers <-call_fib4_notifiers
ip-2678 [001] .... 1651.037883: <stack trace>
View gist:6e0cb81cb994612ab760d000e3253f68
ip-2515 [000] .... 971.573438: call_fib_notifiers <-call_fib4_notifiers
ip-2515 [000] .... 971.573448: <stack trace>
=> call_fib_notifiers
=> call_fib4_notifiers
=> call_fib_entry_notifiers
=> fib_table_delete
=> inet_rtm_delroute
=> rtnetlink_rcv_msg
=> netlink_rcv_skb
=> rtnetlink_rcv
View gist:cc4dc7cd847f8a2836008b3a817ec6e6
titusvpcservice=> \d branch_eni_attachments
Table "public.branch_eni_attachments"
Column | Type | Collation | Nullable | Default
---------------------------+-----------------------------+-----------+----------+----------------------------------------------------
id | integer | | not null | nextval('branch_eni_attachments_id_seq'::regclass)
branch_eni | text | | not null |
trunk_eni | text | | |
idx | integer | | |
association_id | text | | |
View woo.go
package main
import (
"fmt"
"math/rand"
"os"
"path/filepath"
"strconv"
"time"