
Verify Hardening in an ELF With readelf
Write a shell script that uses readelf and nm to fail a build when an ELF binary lacks PIE, full RELRO, a non-executable stack, a stack canary or CET notes.
Tag
255 posts

Write a shell script that uses readelf and nm to fail a build when an ELF binary lacks PIE, full RELRO, a non-executable stack, a stack canary or CET notes.

Follow one H.264 frame through the encoder: macroblocks, intra and inter prediction, the 4x4 integer transform, quantisation, deblocking and CAVLC or CABAC.

Load an eBPF classifier with tc and cls_bpf on ingress or egress using a clsact qdisc, return TC_ACT verdicts, and see how tcx replaces it on Linux 6.6.

Define a default function with __attribute__((weak)) so another object file can replace it at link time, and check optional symbols with weak references.

Diagnose an S0C4 in a COBOL program on z/OS: read the reason code, find the statement, and check subscripts, linkage parameters and storage with SSRANGE.

Turn a Verilog counter into a C++ model with Verilator 5, drive its clock and reset from main(), check outputs in C++ and write a VCD trace with VerilatedVcdC.

Find why a KVM guest is slow or stuck by recording kvm tracepoints with trace-cmd and summarizing VM exits by reason with perf kvm stat, with sample output.

Add stack protector, fortify, PIE, full RELRO and CET flags to a CMake 3.28 project with feature checks, per-target options and a verification step.

Count packets per source IPv4 address in an XDP program with a BPF hash map, then read and print the totals from a libbpf user-space program.

Use __attribute__((section)) to put functions and variables in named ELF sections, then walk the section with the linker's start and stop symbols.

Move sleeping work out of an interrupt handler with INIT_WORK, schedule_work and a worker function on Linux 6.12, including delayed work and safe teardown.

See how KVM reuses the Linux scheduler, memory manager, MMU notifiers, eventfds and cgroups instead of building its own, and where to read each in the source.