# git rev-parse -q --verify 7efd182a94e167c2cb0187009ae1fffa8c485e97^{commit} 7efd182a94e167c2cb0187009ae1fffa8c485e97 already have revision, skipping fetch # git checkout -q -f -B kisskb 7efd182a94e167c2cb0187009ae1fffa8c485e97 # git clean -qxdf # < git log -1 # commit 7efd182a94e167c2cb0187009ae1fffa8c485e97 # Author: Christophe Leroy # Date: Wed Oct 13 17:09:54 2021 +0200 # # lkdtm: Add a test for function descriptors protection # # Add WRITE_OPD to check that you can't modify function # descriptors. # # Gives the following result when function descriptors are # not protected: # # lkdtm: Performing direct entry WRITE_OPD # lkdtm: attempting bad 16 bytes write at c00000000269b358 # lkdtm: FAIL: survived bad write # lkdtm: do_nothing was hijacked! # # Looks like a standard compiler barrier() is not enough to force # GCC to use the modified function descriptor. Had to add a fake empty # inline assembly to force GCC to reload the function descriptor. # # Signed-off-by: Christophe Leroy # Acked-by: Kees Cook # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 7efd182a94e167c2cb0187009ae1fffa8c485e97 # < make -s -j 32 ARCH=mips O=/kisskb/build/chleroy_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # < make -s -j 32 ARCH=mips O=/kisskb/build/chleroy_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- help # make -s -j 32 ARCH=mips O=/kisskb/build/chleroy_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- olddefconfig # make -s -j 32 ARCH=mips O=/kisskb/build/chleroy_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- /kisskb/src/arch/mips/boot/dts/img/boston.dts:128.19-178.5: Warning (pci_device_reg): /pci@14000000/pci2_root@0,0,0: PCI unit address format error, expected "0,0" Completed OK # rm -rf /kisskb/build/chleroy_mips-defconfig_mipsel # Build took: 0:01:03.669548