This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4abc365584b sched/Kconfig: make SCHED_CAPABILITIES opt-in
4abc365584b is described below

commit 4abc365584bc739b5fa32d25cbc4399864a1cfd5
Author: Xiang Xiao <[email protected]>
AuthorDate: Tue Oct 27 12:07:54 2026 +0800

    sched/Kconfig: make SCHED_CAPABILITIES opt-in
    
    SCHED_CAPABILITIES defaults to !DEFAULT_SMALL, so nearly every
    configuration builds the capability checks and the PR_CAPS_* support in
    prctl() unless it opts out. Since nuttx-apps commit e8af3076aa
    ("testing/ostest: test process capabilities"), ostest also builds
    caps.c in those configurations. That is enough to overflow flash on
    boards that are already almost full, and it turns the Build workflow red
    for unrelated pull requests. On current master:
    
      lm3s6965-ek:qemu-protected: region `uflash' overflowed by 760 bytes
      nucleo-g431rb:nsh:          region `flash' overflowed by 56 bytes
    
    Default the option to n instead of opting boards out one defconfig at a
    time as they hit their limit. With the option off every capability check
    passes and prctl() refuses PR_CAPS_DROP and PR_CAPS_GET (EINVAL), which
    the help text already documents. Nothing in Kconfig depends on, selects
    or implies the option. Configurations that want the feature set
    CONFIG_SCHED_CAPABILITIES=y, as ab32vg1-generic:nsh and :ostest already
    do. Update the documentation that described the old default.
    
    Testing: with arm-none-eabi-gcc 13.2.1 on nuttx 3a35e4d402 and
    nuttx-apps 233fa9d1fe97, nucleo-g431rb:nsh (CMake + Ninja) and
    lm3s6965-ek:qemu-protected (Make) configure with the option off and
    link. flash has 868 bytes free on the former and uflash 16 bytes on the
    latter. With the option on they fail with the overflows above. Built
    from a clean committed tree: a "-dirty" version string costs 8 bytes.
    Not run under QEMU or on hardware.
    
    Assisted-by: Copilot <[email protected]>
    Signed-off-by: Xiang Xiao <[email protected]>
---
 Documentation/os/scheduling/capabilities.rst               | 2 +-
 boards/arm/stm32g4/b-g431b-esc1/configs/cansock/defconfig  | 1 -
 boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig | 1 -
 boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig    | 1 -
 sched/Kconfig                                              | 2 +-
 5 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Documentation/os/scheduling/capabilities.rst 
b/Documentation/os/scheduling/capabilities.rst
index 40f23a2b8a2..129f467799d 100644
--- a/Documentation/os/scheduling/capabilities.rst
+++ b/Documentation/os/scheduling/capabilities.rst
@@ -6,7 +6,7 @@ Process capabilities
 
 A process holds three capabilities. Without one, the calls it guards fail
 with ``EPERM``. Every build, the kernel and init start with all three.
-``CONFIG_SCHED_CAPABILITIES``, off with ``DEFAULT_SMALL``, builds the checks.
+``CONFIG_SCHED_CAPABILITIES``, off by default, builds the checks.
 
 =================  ==================================================
 ``PR_CAP_RAWIO``   ``open()`` of block, MTD and BCH nodes,
diff --git a/boards/arm/stm32g4/b-g431b-esc1/configs/cansock/defconfig 
b/boards/arm/stm32g4/b-g431b-esc1/configs/cansock/defconfig
index 043955d4752..d1db95c973f 100644
--- a/boards/arm/stm32g4/b-g431b-esc1/configs/cansock/defconfig
+++ b/boards/arm/stm32g4/b-g431b-esc1/configs/cansock/defconfig
@@ -7,7 +7,6 @@
 #
 # CONFIG_NET_ETHERNET is not set
 # CONFIG_NET_IPv4 is not set
-# CONFIG_SCHED_CAPABILITIES is not set
 CONFIG_ALLOW_BSD_COMPONENTS=y
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="b-g431b-esc1"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig 
b/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
index f00171423e3..157d5740c0a 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
@@ -7,7 +7,6 @@
 #
 # CONFIG_NET_ETHERNET is not set
 # CONFIG_NET_IPv4 is not set
-# CONFIG_SCHED_CAPABILITIES is not set
 CONFIG_ALLOW_BSD_COMPONENTS=y
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="nucleo-g431rb"
diff --git a/boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig 
b/boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig
index c9950b1215f..890b9f37cf0 100644
--- a/boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig
+++ b/boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig
@@ -6,7 +6,6 @@
 # modifications.
 #
 # CONFIG_NSH_DISABLE_DATE is not set
-# CONFIG_SCHED_CAPABILITIES is not set
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="lm3s6965-ek"
 CONFIG_ARCH_BOARD_LM3S6965EK=y
diff --git a/sched/Kconfig b/sched/Kconfig
index bebc9f4a323..cd5c9945819 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -854,7 +854,7 @@ endif # SCHED_USER_IDENTITY
 
 config SCHED_CAPABILITIES
        bool "Process capabilities"
-       default !DEFAULT_SMALL
+       default n
        ---help---
                Task groups hold PR_CAP_RAWIO, PR_CAP_SPAWN and PR_CAP_ADMIN,
                inherit them from their creator and can drop them with

Reply via email to