casaroli opened a new pull request, #21525:
URL: https://github.com/apache/nuttx/pull/21525

   ## Summary
   
   With `CONFIG_SCHED_USER_IDENTITY` the kernel has `issetugid()` 
(`sched/group/group_issetugid.c`), and the user libc leaves out its stub. But 
`syscall.csv` has no line for it. In a protected or a kernel build, a program 
that calls `issetugid()` or `secure_getenv()` does not link:
   
   ```
   secgetenv.c:25:(.text.secgetenv_main+0x22): undefined reference to 
`issetugid'
   libs/libc/environ/env_secureexec.c:147:(.text.secure_getenv+0x6): undefined 
reference to `issetugid'
   ```
   
   This PR adds the system call, next to the other calls of the user identity 
and with the same condition.
   
   ## Impact
   
   Protected and kernel builds with `CONFIG_SCHED_USER_IDENTITY`: one more 
system call. Flat builds do not change. A new entry in `syscall_lookup.h` moves 
the numbers of the calls after it, as every new call does: programs must be 
built again with the kernel. No flat-build API change. No Documentation change: 
`Documentation/standards/posix.rst` already lists `secure_getenv()` as 
supported.
   
   ## Testing
   
   Test program: `issetugid()` returns 0 in a process that is not set-user-ID, 
and `secure_getenv()` gives what `getenv()` gives. It is not in apps; a 
regression guard would need an apps PR. Option: `SCHED_USER_IDENTITY`.
   
   | Config | master bf029a2ef5d | this branch |
   |---|---|---|
   | `qemu-armv8a:knsh` (kernel), HVF | test does not link: `undefined 
references` | 2 PASS, ostest status 0 |
   | `mps2-an500:knsh` (protected), TCG | `nuttx_user.elf` does not link 
(output above) | 2 PASS, ostest status 0 |
   | `qemu-armv8a:nsh` (flat), HVF | 2 PASS, ostest status 0 | 2 PASS, ostest 
status 0 |
   
   The flat build is the control: it calls the kernel function directly. The 
set-user-ID case (`issetugid()` returns 1) was not run. Compilers: aarch64 GCC 
14.2, arm-none-eabi GCC 15.3. The generated proxy and stub are common code for 
every architecture.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to