Commit 09e42214 authored by zhaoxuedong's avatar zhaoxuedong
Browse files

Revert "kbuild: fix false positive warning/error about missing libelf"

openEuler inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAD5GG?from=project-issue


CVE: NA

--------------------

When your development environment does not have the libelf library and you
compile an external module with the "M=xxx" compilation option, the
external module will not have ORC information and there will be no warning
or errors.

If a machine insmod this module and it's process is calling a function in
this module, typing kaptch will result in an error indicating that the
stack of this process is not trustworthy. The worst thing is that if this
module is a necessary and will be used for a long time, kpatch will be
difficult to type.

---------------------

Revert "kbuild: fix false positive warning/error about missing libelf"
This reverts commit ef7cfd00.

Fixes: ef7cfd00 ("kbuild: fix false positive warning/error about missing libelf")
Signed-off-by: default avatarZhao Xuedong <zhaoxuedong@meituan.com>
parent eb95b0d7
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -1100,6 +1100,11 @@ ifdef CONFIG_STACK_VALIDATION
  ifeq ($(has_libelf),1)
    objtool_target := tools/objtool FORCE
  else
    ifdef CONFIG_UNWINDER_ORC
      $(error "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
    else
      $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
    endif
    SKIP_STACK_VALIDATION := 1
    export SKIP_STACK_VALIDATION
  endif
@@ -1249,14 +1254,6 @@ uapi-asm-generic:

PHONY += prepare-objtool prepare-resolve_btfids
prepare-objtool: $(objtool_target)
ifeq ($(SKIP_STACK_VALIDATION),1)
ifdef CONFIG_UNWINDER_ORC
	@echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
	@false
else
	@echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
endif
endif

prepare-resolve_btfids: $(resolve_btfids_target)
ifeq ($(ERROR_RESOLVE_BTFIDS),1)