-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestions for hardened checks #4
Comments
several years ago I had a project where I build full system with annobin enabled it's a gcc (and llvm/clang now too) plugin, that you can add to cflags. it works in a similar way to gcc's own I abandoned project due to lack of interest of other people ( I was not a developer yet) and due to annobin's hard dependency on It had tools for checking hardened, optimization, fortify and other flags. if there's interest I can look at packaging annobin again and maybe working on adding QA checks based on information it gathers and provides. |
Thanks for the ideas. For now this just been on my TODO along other potential features, unsure if or when I'll get to this one -- will check my options then. |
I re-checked annobin - autoconf files in very bad state and it still requires a lot of patching done. # Copyright 2018-2022 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools llvm toolchain-funcs
DESCRIPTION="Binary annotation compiler plugin and tools"
HOMEPAGE="https://nickc.fedorapeople.org"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://sourceware.org/git/${PN}.git"
else
SRC_URI="https://nickc.fedorapeople.org/${P}.tar.xz"
KEYWORDS="~ppc64"
fi
LICENSE="GPL-3"
SLOT="0"
IUSE="clang doc llvm test"
REQUIRED_USE="clang? ( llvm )"
DEPEND=""
RDEPEND="${DEPEND}"
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]]; then
if ! tc-is-gcc ; then
eerror "${PN} is a gcc plugin. Please emerge using gcc as CC"
die "use gcc"
fi
fi
}
src_prepare() {
default
sed -i 's|2.69|2.71|g' config/override.m4 || die
if use llvm; then
local llvmdir="$(get_llvm_prefix -d)"
local llvm_plugindir
llvm_plugindir="$(
clang --print-search-dirs | gawk -e\
'BEGIN { FS = ":" } /libraries/ { print gensub(" =","",1,$2) } END { }'
)"
einfo $llvm_plugindir
sed -i "/^INCDIR.*/ s|$| -I${llvmdir}/include|" {llvm,clang}-plugin/Makefile.in || die
sed -i "/^CLANG_LIBS.*/ s|$| -L${llvmdir}/$(get_libdir)|" clang-plugin/Makefile.in || die
sed -i 's/print-seach-dirs/print-search-dirs/g' {llvm,clang}-plugin/Makefile.in || die
sed -i "s|^PLUGIN_INSTALL_DIR =.*|PLUGIN_INSTALL_DIR = ${D%/}/$(realpath ${llvm_plugindir})|" \
{llvm,clang}-plugin/Makefile.in || die
fi
eautoreconf
}
src_configure() {
local myconf=(
--without-annocheck
--with-libelf
--with-gcc-plugin-dir=$($(tc-getCC) -print-file-name=plugin)
--without-debuginfod # we don't have it enabled, comes with elfutils
$(use_with clang)
$(use_with llvm)
$(use_with test tests)
$(use_with doc docs)
)
econf "${myconf[@]}"
} |
Would be nice to integrate
app-admin/checksec
into this tool. It can report un-hardened libraries and executables, in multiple formats like json and csv.Just be sure to ignore
/usr/lib/debug
in the reportThe text was updated successfully, but these errors were encountered: