From 5ce7fe310a0aa4f47dd792dbdf321b235900f26e Mon Sep 17 00:00:00 2001 From: Lv Ying Date: Tue, 8 Mar 2022 19:10:03 -0800 Subject: [PATCH] Add stack protector compile option Signed-off-by: Lv Ying (cherry picked from commit 092809a9568ecb1654fd8623ecebee4fa63cadca) --- Add-stack-protector-compile-option.patch | 26 ++++++++++++++++++++++++ atune_bpf_collection.spec | 9 +++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Add-stack-protector-compile-option.patch diff --git a/Add-stack-protector-compile-option.patch b/Add-stack-protector-compile-option.patch new file mode 100644 index 0000000..e698d1a --- /dev/null +++ b/Add-stack-protector-compile-option.patch @@ -0,0 +1,26 @@ +From 7b9428779bbbff411c802e5c80a3fbdaee8608e9 Mon Sep 17 00:00:00 2001 +From: Lv Ying +Date: Tue, 8 Mar 2022 19:06:34 -0800 +Subject: [PATCH] Add stack protector compile option + +Signed-off-by: Lv Ying +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 1e070a6..84ff9fd 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,7 +4,7 @@ CLANG ?= clang -v + VMLINUX ?= vmlinux.h + + INCLUDES := -I$(OUTPUT) -I$(dir $(VMLINUX)) +-CFLAGS := -g -Wall ++CFLAGS := -g -Wall -fstack-protector-strong + ARCH := $(shell uname -m | sed 's/x86_64/x86/') + + APPS = readahead_tune +-- +2.27.0 + diff --git a/atune_bpf_collection.spec b/atune_bpf_collection.spec index 453bdbd..a4063b8 100644 --- a/atune_bpf_collection.spec +++ b/atune_bpf_collection.spec @@ -1,12 +1,13 @@ Name: A-Tune-BPF-Collection Version: 1.0.0 -Release: 2 +Release: 3 License: Mulan PSL v2 Summary: BPF program collection to adjust fine-grained kernel mode to get better performance URL: https://gitee.com/openeuler/A-Tune-BPF-Collection Source0: https://gitee.com/openeuler/A-Tune-BPF-Collection/repository/archive/v%{version}.tar.gz Patch1: use-generated-vmlinux.h-instead-of-bpftool-gen-vmlin.patch +Patch2: Add-stack-protector-compile-option.patch BuildRequires: clang, llvm, libbpf-devel Requires: libbpf @@ -38,6 +39,12 @@ install -D -p -m 0644 readahead_tune.conf %{buildroot}%{_sysconfdir}/sysconfig/r %config(noreplace) %{_sysconfdir}/sysconfig/readahead_tune.conf %changelog +* Wed Mar 9 2022 lvying - 1.0.0-3 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Add stack protector compile option + * Wed Dec 8 2021 lvying - 1.0.0-2 - Type:bugfix - ID:NA