Project

General

Profile

Actions

Bug #14204

closed

[PATCH] socket: use frozen string buffer when releasing GVL

Bug #14204: [PATCH] socket: use frozen string buffer when releasing GVL

Added by normalperson (Eric Wong) almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
[ruby-core:84346]

Description

socket: use frozen string buffer when releasing GVL Using a non-frozen string buffer when GVL is released is dangerous because another thread may modify that buffer. This may lead to the contents of an invalid pointer being written to the socket. Follow the lead used with core io.c methods and duplicate the string to a temporary frozen buffer before writing. * ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_str_tmp_frozen_{acquire/release} as with IO#write * internal.h (rb_str_tmp_frozen_acquire): export (rb_str_tmp_frozen_release): export 

related to [Bug #14195]


Files

Updated by akr (Akira Tanaka) over 6 years ago Actions #1

  • Status changed from Open to Closed

Applied in changeset git|4900a10689036211da79c8189ff7eba11c8c81ee.


socket: use frozen string buffer when releasing GVL

Thanks for the patch by normalperson (Eric Wong) [Bug #14204].

Actions

Also available in: PDF Atom