Skip to content

[PW_SID:1089900] [v2] riscv/futex: Bound number of LL/SC retries in cmpxchg#1869

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1089900
Closed

[PW_SID:1089900] [v2] riscv/futex: Bound number of LL/SC retries in cmpxchg#1869
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1089900

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1089900 applied to workflow__riscv__fixes

Name: [v2] riscv/futex: Bound number of LL/SC retries in cmpxchg
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1089900
Version: 2

Linux RISC-V bot and others added 2 commits May 2, 2026 08:13
futex_atomic_cmpxchg_inatomic() does an unbounded LR/SC retry loop while
(minimally) holding the hb lock + pf disabled. This can lead to pathological
cases from unpriviledged userspace pi operations.

Bound the retry loop to (arbitrarily) 128 iterations and bail: drop locks,
rechedule and retry the operation, similar to the arm64 variant, as of
03110a5 ("arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP").

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1151.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1699.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.57 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.24 seconds
Result: WARNING
Output:

WARNING: 'unpriviledged' may be misspelled - perhaps 'unprivileged'?
#8: 
cases from unpriviledged userspace pi operations.
           ^^^^^^^^^^^^^

WARNING: unnecessary whitespace before a quoted newline
#46: FILE: arch/riscv/include/asm/futex.h:94:
+	"	beqz %[t],3f				\n"

WARNING: unnecessary whitespace before a quoted newline
#47: FILE: arch/riscv/include/asm/futex.h:95:
+	"	addi %[lp],%[lp],-1			\n"

WARNING: unnecessary whitespace before a quoted newline
#48: FILE: arch/riscv/include/asm/futex.h:96:
+	"	bnez %[lp],1b				\n"

WARNING: unnecessary whitespace before a quoted newline
#49: FILE: arch/riscv/include/asm/futex.h:97:
+	"	li %[r],%[eagain]			\n"

total: 0 errors, 5 warnings, 0 checks, 35 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 2c75db7b85f8 ("riscv/futex: Bound number of LL/SC retries in cmpxchg") 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, 5 warnings, 0 checks, 35 lines checked
WARNING: 'unpriviledged' may be misspelled - perhaps 'unprivileged'?
WARNING: unnecessary whitespace before a quoted newline


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
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: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
kdoc
Desc: Detects for kdoc errors
Duration: 0.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv/futex: Bound number of LL/SC retries in cmpxchg"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 2c3b264 to 2d4fcdd Compare May 10, 2026 02:08
@linux-riscv-bot linux-riscv-bot deleted the pw1089900 branch May 13, 2026 02:19
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