txy-21 opened a new pull request, #21791:
URL: https://github.com/apache/nuttx/pull/21791

   ## Summary
   
     * MAX_MQUEUE_PATH was a fixed 64 bytes, independent of
       CONFIG_FS_MQUEUE_VFS_PATH and CONFIG_NAME_MAX.  With the default
       "/var/mqueue" path it accepted queue names longer than {NAME_MAX};
       with a longer configured path it rejected names that would fit.
     * Changed part: fs/mqueue, the full path buffer in mq_open.c and
       mq_unlink.c and the length check in file_mq_vopen().
     * How it works: the buffer is now
       sizeof(CONFIG_FS_MQUEUE_VFS_PATH) + CONFIG_NAME_MAX + 1, so both the
       check and the buffer follow the configuration.
     * Related NuttX issue: none.
     * Related NuttX Apps issue/PR: none.
     * Regression test: not added; covering this needs a test that opens a
       queue with a name longer than {NAME_MAX} and checks ENAMETOOLONG,
       which ostest does not have.
   
   ## Impact
   
     * Is new feature added? NO
     * Is existing feature changed? YES - the accepted queue name length
       follows CONFIG_FS_MQUEUE_VFS_PATH and CONFIG_NAME_MAX instead of a
       fixed 64-byte buffer.
     * Impact on user? YES - mq_open() returns ENAMETOOLONG for a name that
       does not fit the configured VFS path and NAME_MAX.  With the default
       path the limit is CONFIG_NAME_MAX - 1 characters instead of 50.
     * Impact on build? NO
     * Impact on hardware? NO
     * Impact on documentation? NO
     * Impact on security? NO
     * Impact on compatibility? YES - see above.
     * Anything else to consider or add? No.
   
   ## Testing
   
     I confirm that changes are verified on local setup and works as intended:
   
     * Target(s): sim:nsh and sim:ostest (x86_64 simulator)
   
     Testing logs before change:
   
     ```
     Not captured: no existing simulator application opens a message queue
     with a long name; ostest uses short names only.
     ```
   
     Testing logs after change:
   
     ```
     nsh> uname -a
     NuttX 0.0.0 de122613f6 Nov 12 2026 19:47:27 sim sim
     nsh> poweroff
     ```
   
     sim:ostest, message queue tests (the run was stopped after these):
   
     ```
     receiver_thread: Receive 9 timed out as expected
     receiver_thread: returning nerrors=0
     timedmqueue_test: Test complete
     ```
   
     ```
     sender_thread: returning nerrors=0
     mqueue_test: Killing receiver
     receiver_thread: mq_receive interrupted!
     receiver_thread: returning nerrors=0
     ```
   
     The full ostest run was not completed; the later tests were not run.
   
     Net .text/.data/.bss of the sim:nsh image is unchanged:
     1491610 / 278096 / 193792 bytes before and after.
   
     Not tested:
   
     * Protected and kernel builds: the test host has no cross toolchain and
       the simulator has no such configuration.
     * Real hardware and other architectures.
     * Exact NAME_MAX boundary: the existing ">=" comparison in
       file_mq_vopen() keeps rejecting a name of exactly CONFIG_NAME_MAX
       characters.
   
   ## PR verification Self-Check
   
     * [x] This PR introduces only one functional change.
     * [x] I have updated all required description fields above.
     * [x] My PR adheres to Contributing Guidelines and Documentation (git 
commit title and message, coding standard, etc).
     * [ ] My PR is still work in progress (not ready for review).
     * [x] My PR is ready for review and can be safely merged into a codebase.
   


-- 
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