History

Merge tag 'memcpy-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull FORTIFY_SOURCE updates from Kees Cook: "This series consists of two halves: - strict compile-time buffer size checking under FORTIFY_SOURCE for the memcpy()-family of functions (for extensive details and rationale, see the first commit) - enabling FORTIFY_SOURCE for Clang, which has had many overlapping bugs that we've finally worked past" * tag 'memcpy-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: fortify: Add Clang support fortify: Make sure strlen() may still be used as a constant expression fortify: Use __diagnose_as() for better diagnostic coverage fortify: Make pointer arguments const Compiler Attributes: Add __diagnose_as for Clang Compiler Attributes: Add __overloadable for Clang Compiler Attributes: Add __pass_object_size for Clang fortify: Replace open-coded __gnu_inline attribute fortify: Update compile-time tests for Clang 14 fortify: Detect struct member overflows in memset() at compile-time fortify: Detect struct member overflows in memmove() at compile-time fortify: Detect struct member overflows in memcpy() at compile-time

Linus Torvalds committed 4 years ago

Commit 4be240b2 parents 3f72821 281d0c913 files · +272 −56Browse files

Showing the changes to scripts (1 of 13 files). Show all

Unified · Split

scripts/test_fortify.sh+6−2
@@ -46,8 +46,12 @@ if "$@" -Werror -c "$IN" -o "$OUT".o 2> "$TMP" ; then · 45 unmodified lines
4646 status="warning: unsafe ${FUNC}() usage lacked '$WANT' symbol in $IN"
4747 fi
4848 else
49− # If the build failed, check for the warning in the stderr (gcc).
50− if ! grep -q -m1 "error: call to .\b${WANT}\b." "$TMP" ; then
49+ # If the build failed, check for the warning in the stderr.
50+ # GCC:
51+ # ./include/linux/fortify-string.h:316:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
52+ # Clang 14:
53+ # ./include/linux/fortify-string.h:316:4: error: call to __write_overflow_field declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
54+ if ! grep -Eq -m1 "error: call to .?\b${WANT}\b.?" "$TMP" ; then
5155 status="warning: unsafe ${FUNC}() usage lacked '$WANT' warning in $IN"
5256 fi
5357 fi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t