Skip to content

Instantly share code, notes, and snippets.

@feiyax
feiyax / ssd_nvme_4kn_support.md
Last active October 4, 2024 21:01
SSD NVMe 4K Block Size Support

Here to document the SSDs i came acorss regarding their support to 4K block size.

The context is that while the majority of NAND uses 4K page size at the lowest level, many SSDs still expose itself as 512-byte sector size. NVMe has an optional feature to toggle the device between different block size, but information regarding this feature isn't easily available from vendors. That means some SSDs can be set to show 4K sector size to OS, some cannot.

nvme-cli command used:

dev=/dev/nvme0n1; sudo sh -c "\
    nvme id-ctrl $dev | \
 grep '^\(mn\|fr\)\s' ; \
@feiyax
feiyax / kmod_validate.md
Last active April 15, 2024 16:39
Manually Validate Kernel Module Signature

Pre-req

  • kernel module *.ko
  • signing key signing_key.pem (containing private key and certificate)
  • scripts dir in linux source. usually also in /usr/src/linux-headers-$(uname -r)/scripts/
  • don't have whitespace in path. (yeam i'm too lazy to type quotes)

Convert everything into desired formats

extract the signature part and the data content parts out of the *.ko