Skip to content

[PW_SID:1158543] entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL - #2596

Open
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1158543
Open

[PW_SID:1158543] entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL#2596
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1158543

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1158543 applied to workflow__riscv__fixes

Name: entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1158543
Version: 1

A bunch of older cross compilers notably RISCV64 and S390 fail to eliminate
the dead code when CONFIG_AUDITSYSCALL=n. The code in question is:

     if (unlikely(audit_context())
     	syscall_enter_audit(regs);

and in case of CONFIG_AUDITSYSCALL=n:

  static inline struct audit_context *audit_context(void)
  {
        return NULL;
  }

which should make the compiler eliminate the syscall_enter_audit()
call. But a RISV64 GCC12 cross compiler translates that into:

        if (unlikely(audit_context()))
    1c34:       00000097                auipc   ra,0x0
    1c38:       000080e7                jalr    ra # 1c34 <.L785>
    1c3c:       c511                    beqz    a0,1c48 <.L787>
                syscall_enter_audit(regs);
    1c3e:       8526                    mv      a0,s1
    1c40:       00000097                auipc   ra,0x0
    1c44:       000080e7                jalr    ra # 1c40 <.L785+0xc>

and then claims in the failing link:

   include/asm-generic/preempt.h:54:(.noinstr.text+0x1a20):
	undefined reference to 'syscall_enter_audit'

which is obviously hallucination.

Add an explicit IS_ENABLED(CONFIG_AUDITSYSCALL) check into the condition to
cure this compiler madness.

Fixes: 6f25517 ("entry: Rework syscall_audit_enter()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202609031938.ZvZZaRQy-lkp@intel.com/
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1480.16 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1801.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 32.69 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.76 seconds
Result: WARNING
Output:

WARNING: Reported-by: should be immediately followed by Closes: or Link: with a URL to the report
#43: 
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>

total: 0 errors, 1 warnings, 0 checks, 15 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 22e9e69cfc13 ("entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 15 lines checked
WARNING: Reported-by: should be immediately followed by Closes: or Link: with a URL to the report


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 91.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
kdoc
Desc: Detects for kdoc errors
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.81 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant