Bug 206740 - There is no check for iconv* functions when the libiconv library loaded by dlopen
Summary: There is no check for iconv* functions when the libiconv library loaded by dl...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-01-29 17:42 UTC by Iouri V. Ivliev
Modified: 2018-09-03 14:54 UTC (History)
3 users (show)

See Also:


Attachments
fixes use of iconv* functions from library loaded by dlopen. (1.37 KB, application/x-gzip)
2016-01-29 17:42 UTC, Iouri V. Ivliev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iouri V. Ivliev 2016-01-29 17:42:10 UTC
Created attachment 166274 [details]
fixes use of iconv* functions from library loaded by dlopen.

When the world is compiled without iconv support in libc, some code in the base system tries to use the iconv* functions from the external library (usually converters/libiconv port). For now, the code in libkiconv and libsmb doesn't check the presence of iconv* functions in the loaded library. Starting with libiconv-1.14_9 iconv* rymbols are not exported from libiconv.so. As a result, there is a segmentation faults in the code that uses libkiconv and libsmb.

A set of patches for libkiconv, libsmb and csh fixes some issues when use iconv* functions from libiconv loaded by dlopen(3):
1. allows to load alternative libiconv library using LIBICONV environment variable.
2. tries fallback to iconv_open, iconv and iconv_close functions when libiconv_open, libiconv and libiconv_close symbols are not exported from loaded library.
3. an error will be returned when any functions are missing in the library.

This should fix at least https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205256 and segfaults in mount_msdosfs.
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-09-03 14:54:17 UTC
see bug #205256. Overcome by events.