Skip to content

Rework REFCOUNT_FULL using atomic_fetch_* operations

Will Deacon kernel-hardening lkml oe-lkp 5 versions – Applied

Status from this message: The following commit has been merged into the locking/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest posting 2/210 patches 12 repliesApplied
  2. v4 posting 1/210 patches 3 repliesSuperseded
  3. v310 patches 11 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches9 repliesSuperseded
v16 patches8 repliesSuperseded

Patches in v4 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/10lib/refcount: Define constants for saturation and max refcount valuesdrivers/misc/lkdtm/refcount.c include/linux/refcount.h lib/refcount.c+29 -260 replies
2/10lib/refcount: Ensure integer operands are treated as signedinclude/linux/refcount.h lib/refcount.c+10 -100 replies
3/10lib/refcount: Remove unused refcount_*_checked() variantsinclude/linux/refcount.h lib/refcount.c+36 -433 replies
4/10lib/refcount: Move bulk of REFCOUNT_FULL implementation into headerinclude/linux/refcount.h lib/refcount.c+229 -2460 replies
5/10lib/refcount: Improve performance of generic REFCOUNT_FULL codeinclude/linux/refcount.h+75 -563 replies
6/10lib/refcount: Move saturation warnings out of lineinclude/linux/refcount.h lib/refcount.c+48 -190 replies
7/10lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitionsinclude/linux/refcount.h+2 -70 replies
8/10refcount: Consolidate implementations of refcount_tarch/Kconfig arch/arm/Kconfig arch/arm64/Kconfig +8 more+59 -3084 replies
9/10lib/refcount: Remove unused 'refcount_error_report()' functioninclude/linux/kernel.h kernel/panic.c+0 -180 replies
10/10drivers/lkdtm: Remove references to CONFIG_REFCOUNT_FULLdrivers/misc/lkdtm/refcount.c+1 -20 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKees CookHanjun GuoJan GlauberArd Biesheuvel
SeriesT-b R-b
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b T-b T-b
6/10R-b
7/10R-b
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [RESEND PATCH v4 00/10] Rework REFCOUNT_FULL using atomic_fetch_* operations

Hi everybody,

This is a resend of version four of the patches I posted here:

v4: https://lore.kernel.org/lkml/[email protected]

Previous versions can be found at:

v1: https://lkml.kernel.org/r/[email protected]
v2: https://lkml.kernel.org/r/[email protected]
v3: https://lkml.kernel.org/r/[email protected]

I didn't receive any feedback last time around, other than some positive noises from Kees, so please consider this for inclusion in mainline.

Thanks,

Will

Cc Kees Cook <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Elena Reshetova <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Hanjun Guo <[email protected]>

--->8

Will Deacon (10):
lib/refcount: Define constants for saturation and max refcount values lib/refcount: Ensure integer operands are treated as signed lib/refcount: Remove unused refcount_*_checked() variants lib/refcount: Move bulk of REFCOUNT_FULL implementation into header lib/refcount: Improve performance of generic REFCOUNT_FULL code lib/refcount: Move saturation warnings out of line lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions
refcount: Consolidate implementations of refcount_t lib/refcount: Remove unused 'refcount_error_report()' function drivers/lkdtm: Remove references to CONFIG_REFCOUNT_FULL

 arch/Kconfig                       |  21 ---
 arch/arm/Kconfig                   |   1 -
 arch/arm64/Kconfig                 |   1 -
 arch/s390/configs/debug_defconfig  |   1 -
 arch/x86/Kconfig                   |   1 -
 arch/x86/include/asm/asm.h         |   6 -
 arch/x86/include/asm/refcount.h    | 126 --------------
 arch/x86/mm/extable.c              |  49 ------
 drivers/gpu/drm/i915/Kconfig.debug |   1 -
 drivers/misc/lkdtm/refcount.c      |  11 +-
 include/linux/kernel.h             |   7 -
 include/linux/refcount.h           | 269 ++++++++++++++++++++++++-----
 kernel/panic.c                     |  11 --
 lib/refcount.c                     | 255 +++------------------------
 14 files changed, 257 insertions(+), 503 deletions(-)
 delete mode 100644 arch/x86/include/asm/refcount.h
Signature · 1 line
2.24.0.432.g9d3f5f5b63-goog