Skip to content

Instantly share code, notes, and snippets.

View jmgao's full-sized avatar
☢️
ͬͤ ͬͬͤ ͦͬͬͤ ͬͦͬͬͤ ͤͬͦͬͬͤ ͬͤͬͦͬͬͤ ͬͬͤͬͦͬͬͤ ͦͬͬͤͬͦͬͬͤ ͬͦͬͬͤͬͦͬͬͤ ͤͬͦͬͬͤͬͦͬͬͤ ͬͦͬͬͤ

Josh Gao jmgao

☢️
ͬͤ ͬͬͤ ͦͬͬͤ ͬͦͬͬͤ ͤͬͦͬͬͤ ͬͤͬͦͬͬͤ ͬͬͤͬͦͬͬͤ ͦͬͬͤͬͦͬͬͤ ͬͦͬͬͤͬͦͬͬͤ ͤͬͦͬͬͤͬͦͬͬͤ ͬͦͬͬͤ
View GitHub Profile
From 2c43231ecfd0c0fbb6850ebb6d65b0f62c29ba4a Mon Sep 17 00:00:00 2001
From: Josh Gao <jmgao@fb.com>
Date: Mon, 13 Sep 2021 17:16:17 -0700
Subject: [PATCH] selinux: optionally send signal on audit.
Allow processes to opt into receiving a signal upon audit failure, via
a new file at /proc/PID/selinux/audit_signal.
This is intended to be used primarily as a debugging facility, either
with a userspace signal handler/core dump, or interactively with
@jmgao
jmgao / gist:97b9967292557b416ebfcf2167552176
Created November 18, 2020 05:13
pl_bluepill `bloaty -s vm -d symbols build/zephyr/zephyr.elf -n 0`
VM SIZE FILE SIZE
-------------- --------------
15.5% 9.55Ki allocator 46 0.0%
3.7% 2.25Ki z_main_stack 45 0.0%
3.2% 2.00Ki z_interrupt_stacks 51 0.0%
2.7% 1.69Ki mbedtls_internal_sha256_process 1.76Ki 0.2%
2.7% 1.68Ki usb_dc_stm32_state 51 0.0%
2.0% 1.23Ki mpi_mul_hlp 1.27Ki 0.1%
1.7% 1.05Ki HAL_PCD_IRQHandler 1.13Ki 0.1%
1.6% 1024 sys_work_q_stack 49 0.0%
diff ward_orig/content.opf ward_new/content.opf
6c6
< <dc:identifier id="uuid" opf:scheme="uuid">66b23f28-81ea-47de-835b-e23b3871e5cb</dc:identifier>
---
> <dc:identifier id="uuid" opf:scheme="uuid">e156c107-6136-49eb-9621-d4081d59cf73</dc:identifier>
Common subdirectories: ward_orig/META-INF and ward_new/META-INF
diff ward_orig/-tmp-content-12.html ward_new/-tmp-content-12.html
21c21
< <p><strong><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="31615e585f456e7c546e71">[email&#160;protected]</a>_The_Sky</strong><strong>: </strong>Staying the night at work.&#160; Don’t fuss about me.&#160; Tell the Dallon parental units if you think it’s necessary to keep them from going on warpath.&#160; I want to be left alone for now</p>
---
function _cherry() {
local dry=$1
local src_branch=$2
local local_path=$3
if [[ -z "$local_path" ]]; then
local_path="."
fi
echo "git cherry $src_branch HEAD | grep '^+' | cut -d' ' -f2"
for sha in `git cherry $src_branch HEAD | grep '^+' | cut -d' ' -f2`; do
if [[ -e $local_path ]]; then
import sun.misc.Cleaner;
import java.util.concurrent.atomic.AtomicBoolean;
class Resource {
private AtomicBoolean cleaned;
public Resource(AtomicBoolean b) {
this.cleaned = b;
}
public void clean() {
<?xml version="1.0"?>
<manifest>
<remote fetch=".." name="aosp" review="https://android-review.googlesource.com/"/>
<default remote="aosp" revision="sdk-release"/>
<project groups="pdk" name="platform/external/lzma" path="external/lzma" revision="f1b366131bac064f0dd820ba0e20012e2ada52f0"/>
<project groups="pdk" name="platform/external/protobuf-javalite" path="external/protobuf-javalite" revision="f23f4109a3ef91b9f05c92b091d49b1194081ee8"/>
<project groups="device,pdk" name="device/google/cuttlefish_common" path="device/google/cuttlefish_common" revision="35588f31c28251e15ec87dc66ef9f727ba2473ef"/>
<project groups="pdk" name="platform/bootable/recovery" path="bootable/recovery" revision="cdb70e00c7d97e28bc5141fd849471af25308217"/>
<project groups="pdk" name="platform/system/bpfprogs" path="system/bpfprogs" revision="47226c64a22053440887f521647109d1c27ea941"/>
<project groups="pdk" name="platform/hardware/google/apf" path="hardware/google/apf" revision="02c3c86963b53e9191db387feca2c9e77c90ceaa"/
/**
* Retrieves the socket name from the OS.
*
* @return non-null; socket name
* @throws IOException on failure
*/
public LocalSocketAddress getSockAddress() throws IOException {
// This method has never been implemented.
return null;
}
@jmgao
jmgao / test.s
Created February 20, 2019 02:56
test.integrated.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <_Z5flushv>:
0: b0a1 sub sp, #132 ; 0x84
2: 2000 movs r0, #0
4: 9020 str r0, [sp, #128] ; 0x80
6: e85d 0f80 ldrex r0, [sp, #512] ; 0x200
class AutoMutex {
public:
inline AutoMutex() : mLockCount(0) {
int expected = 0;
__c11_atomic_compare_exchange_weak(&mLockCount, &expected, expected + 1,
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
}
private:
char x[128];
@jmgao
jmgao / test.cpp
Last active February 20, 2019 02:29
extern void escape(void* p);
class AutoMutex {
public:
inline AutoMutex() : mLockCount(0) {
int expected = 0;
__c11_atomic_compare_exchange_weak(&mLockCount, &expected, expected + 1,
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
}