nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

add tls cleanup toprotect udp

Open wangchen61698 opened this issue 1 year ago • 3 comments

Summary

Due to abnormal application exit,so add tls cleanup to protect udp process

Impact

udp

Testing

Manual verification

wangchen61698 avatar Aug 20 '24 07:08 wangchen61698

@xiaoxiang781216 The life cycle of the socket should be managed with file descriptor. If an abnormal exit causes an exception, then the VFS needs to be further enhanced. If all subsystems depends on TLS when exiting, then the entire kernel will be surrounded by TLS. The implementation of the protocol stack should further learn from the Linux kernel instead of applying these ugly patches!

anchao avatar Aug 21 '24 00:08 anchao

If similar changes are allowed, in the future any waiting logic in the subsystem will need to depends on tls_cleanup_push/tls_cleanup_pop, Is this what you expect?

anchao avatar Aug 21 '24 00:08 anchao

@xiaoxiang781216 The life cycle of the socket should be managed with file descriptor. If an abnormal exit causes an exception, then the VFS needs to be further enhanced. If all subsystems depends on TLS when exiting, then the entire kernel will be surrounded by TLS. The implementation of the protocol stack should further learn from the Linux kernel instead of applying these ugly patches!

@anchao Agree, and maybe we'll not merge this PR into the master. BTW, is CONFIG_CANCELLATION_POINTS well tested? Socket operations are already protected by cancellation points, but we haven't enabled it on products yet.

wengzhe avatar Aug 23 '24 04:08 wengzhe