)]}'
{"id":"openvpn~2213","triplet_id":"openvpn~master~I8fe2cbeadde3bad2185c4cee824ed2fe307e29e2","project":"openvpn","branch":"master","full_branch":"refs/heads/master","attention_set":{"1000070":{"account":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"last_update":"2026-11-18 11:07:33.000000000","reason":"\u003cGERRIT_ACCOUNT_1000001\u003e replied on the change","reason_account":{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."}},"1000003":{"account":{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},"last_update":"2026-11-17 16:42:08.000000000","reason":"Reviewer was added"}},"removed_from_attention_set":{"1000001":{"account":{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},"last_update":"2026-11-18 11:07:33.000000000","reason":"\u003cGERRIT_ACCOUNT_1000001\u003e replied on the change","reason_account":{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."}}},"hashtags":[],"change_id":"I8fe2cbeadde3bad2185c4cee824ed2fe307e29e2","subject":"configure: add compiler and linker hardening flags","status":"NEW","created":"2026-11-17 16:42:06.000000000","updated":"2026-11-18 11:07:33.000000000","submit_type":"CHERRY_PICK","total_comment_count":1,"unresolved_comment_count":1,"has_review_started":true,"meta_rev_id":"199fc92d1198fe1fecb6ae504713418a671d815d","_number":2213,"virtual_id_number":2213,"owner":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"actions":{},"labels":{"Code-Review":{"all":[{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."}],"values":{"-2":"This shall not be submitted","-1":"I would prefer this is not submitted as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"}],"CC":[{"_account_id":1000026,"name":"openvpn-devel","email":"openvpn-devel@lists.sourceforge.net","username":"openvpn-devel"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2026-11-17 16:42:06.000000000","updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"real_updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"reviewer":{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},"state":"REVIEWER"},{"updated":"2026-11-17 16:42:08.000000000","updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"real_updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"reviewer":{"_account_id":1000026,"name":"openvpn-devel","email":"openvpn-devel@lists.sourceforge.net","username":"openvpn-devel"},"state":"CC"},{"updated":"2026-11-17 16:42:08.000000000","updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"real_updated_by":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"reviewer":{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},"state":"REVIEWER"}],"messages":[{"id":"9e5a574fd898a001a82ff383047331fd9309d4d9","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"date":"2026-11-17 16:42:06.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"b0f5952e4c6564cf65b24ef3a2b6d3aa6e682a67","author":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"date":"2026-11-17 16:42:53.000000000","message":"Patch Set 1:\n\nThis is the autotools half of adding GCC/clang hardening flags, along\nthe lines of what the MSVC build already does with /sdl, /guard:cf and\n/CETCOMPAT (2612125d). If the approach is acceptable, the CMake build\n(used for mingw and development builds) follows in a separate change.\n\nThree points where I would like your opinion:\n\n1. It is on by default, with --disable-hardening to turn it off. A flag\n   set in CFLAGS or LDFLAGS still wins, for example -fno-stack-protector\n   or -Wl,-z,lazy as OpenWrt and Buildroot use. If you prefer opt-in,\n   that is a one-word change.\n\n2. -fcf-protection\u003dfull only marks the binaries as IBT/SHSTK\n   compatible. Linux enforces shadow stacks only where the kernel and\n   glibc enable them. It is cheap and matches what distributions ship,\n   but I can drop it.\n\n3. I wrote a small macro instead of importing AX_CHECK_LINK_FLAG and\n   AX_ADD_FORTIFY_SOURCE from autoconf-archive, because the probe has to\n   treat linker warnings as failures and must not override a FORTIFY\n   level chosen elsewhere. Happy to switch to the archive macros if you\n   prefer them.\n\nThe testing is summarised in the commit message. I only had x86_64\nLinux, so the buildbot results for the BSDs, macOS (arm64 with\n-mbranch-protection) and Solaris will be the first real check there. I\ncan share the container build logs (patched against master, with the\nELF checks of each binary) if they are useful.","accounts_in_message":[],"_revision_number":1},{"id":"199fc92d1198fe1fecb6ae504713418a671d815d","author":{"_account_id":1000001,"name":"Frank Lichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},"date":"2026-11-18 11:07:33.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1}],"current_revision_number":1,"current_revision":"eace777a91aea4065622707b07668aaed6b3883b","revisions":{"eace777a91aea4065622707b07668aaed6b3883b":{"kind":"REWORK","_number":1,"created":"2026-11-17 16:42:06.000000000","uploader":{"_account_id":1000070,"name":"Aravind O R","email":"aravindor@gmail.com","username":"aravindor"},"ref":"refs/changes/13/2213/1","fetch":{"anonymous http":{"url":"https://gerrit.openvpn.net/openvpn","ref":"refs/changes/13/2213/1","commands":{"Branch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1 \u0026\u0026 git checkout -b change-2213 FETCH_HEAD","Checkout":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1","Reset To":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/13/2213/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"4721ed8df56c8d2e97da0079d01e5e2a87054fb8","subject":"Various trivial -Wsign-conversion fixes (part 2)"}],"author":{"name":"Aravind O R","email":"aravindor@gmail.com","date":"2026-11-17 01:57:57.000000000","tz":330},"committer":{"name":"Aravind O R","email":"aravindor@gmail.com","date":"2026-11-17 10:46:15.000000000","tz":330},"subject":"configure: add compiler and linker hardening flags","message":"configure: add compiler and linker hardening flags\n\nThe MSVC build already hardens the binaries with /sdl, /guard:cf and,\nfor x86/x64 Release builds, /CETCOMPAT. A ./configure build only gets\nwhat the compiler enables by default or what is passed in CFLAGS and\nLDFLAGS. Distribution packages get hardening flags from their build\ntools, but self-built binaries, ports and embedded builds often do not.\nCompiler defaults differ too: on Ubuntu 24.04 a build with gcc gets a\nstack protector and BIND_NOW, the same build with clang gets neither.\n\nAdd a subset of the flags recommended by the OpenSSF \"Compiler Options\nHardening Guide for C and C++\", where the toolchain accepts them:\n\n  -D_FORTIFY_SOURCE\u003d3 (or 2)\n  -fstack-protector-strong\n  -fstack-clash-protection\n  -fcf-protection\u003dfull (x86) or -mbranch-protection\u003dstandard (arm64)\n  -Wl,-z,relro -Wl,-z,now\n\nA flag is only used if a small test program with a stack buffer and\ncalls to fortified libc functions still compiles and links without any\nwarning. Warnings count as failure because GNU ld and lld only warn\nabout an unknown -z option.\n\nThe accepted flags go in front of CFLAGS and LDFLAGS, so a choice made\nthere, like -fno-stack-protector or -Wl,-z,lazy, takes precedence.\n--disable-hardening turns all of this off.\n\n_FORTIFY_SOURCE goes into CFLAGS rather than CPPFLAGS, as Fedora and\nArch do, because it needs optimization: \"make CFLAGS\u003d-O0\" then drops it\ntogether with the -O flag. Level 3 needs GCC 12 or clang 9, otherwise\nlevel 2 is used. Unlike the guide, this does not use -U_FORTIFY_SOURCE,\nso a level chosen elsewhere is respected: the define is skipped when\nCPPFLAGS, CFLAGS or the compiler set another level or\n-U_FORTIFY_SOURCE, when building without optimization, and for ASan\nbuilds. In a test with clang 23, a fortified memcpy() overflow aborted\nwith \"buffer overflow detected\" before ASan could report it.\n\nMinGW builds are not changed: there -fstack-protector and\n_FORTIFY_SOURCE can need libssp or a recent mingw-w64 runtime. PIE is\nleft to the toolchain default. The CMake build can follow in a separate\npatch.\n\nTested on x86_64 Linux with GCC 16.2, clang 23.1, glibc 2.44 and the\nbfd, gold and lld linkers: configure with 13 combinations of CC,\nCPPFLAGS, CFLAGS and LDFLAGS (among them the Arch package flags,\nDebian-style flags, -O0, -U_FORTIFY_SOURCE and the ASan flags of the\nGitHub workflow), and \"make check\" of --enable-werror builds with gcc,\nclang, and clang with ASan/UBSan.\n\nThe same builds, with and without this patch, in containers: Ubuntu\n22.04 and 24.04, Debian 11 and 12, AlmaLinux 9 and Alpine 3.22 (musl),\ncovering GCC 10 to 14 and clang 11 to 22. No new warnings, and the\nonly failing test, t_net, fails without the patch too (the containers\nhave no ip tool). On AlmaLinux 9 (GCC 11, glibc 2.34) level 3 is\nrejected and level 2 used. Debian 11 gcc and Alpine clang fail\n--enable-werror with and without this patch, because of existing\n-Wconversion and -Wsign-compare warnings.\n\nNot tested: the BSDs, macOS, Solaris and architectures other than\nx86_64.\n\nAssisted-by: Claude Code:claude-opus-5-5\nChange-Id: I8fe2cbeadde3bad2185c4cee824ed2fe307e29e2\nSigned-off-by: Aravind O R \u003caravindor@gmail.com\u003e\n"},"branch":"refs/heads/master"}},"requirements":[{"status":"NOT_READY","fallback_text":"All required checks must pass","type":"checks_pass"}],"submit_records":[{"rule_name":"gerrit~DefaultSubmitRule","status":"NOT_READY","labels":[{"label":"Code-Review","status":"NEED"}]},{"rule_name":"checks~ChecksSubmitRule","status":"NOT_READY","requirements":[{"status":"NOT_READY","fallback_text":"All required checks must pass","type":"checks_pass"}]}]}
