libports: libubsan and libsanitizer_common

Issue #3072
This commit is contained in:
Christian Prochaska 2018-12-06 01:03:47 +01:00 committed by Norman Feske
parent 03cbd4257f
commit c2884a6e63
13 changed files with 1040 additions and 0 deletions

View File

@ -0,0 +1,32 @@
SANITIZER_PORT_DIR := $(call select_from_ports,sanitizer)
SANITIZER_DIR := $(SANITIZER_PORT_DIR)/src/lib/sanitizer
SRC_CC = sanitizer_allocator.cc \
sanitizer_common.cc \
sanitizer_common_libcdep.cc \
sanitizer_coverage_libcdep.cc \
sanitizer_coverage_mapping_libcdep.cc \
sanitizer_flag_parser.cc \
sanitizer_flags.cc \
sanitizer_genode.cc \
sanitizer_libc.cc \
sanitizer_persistent_allocator.cc \
sanitizer_printf.cc \
sanitizer_stackdepot.cc \
sanitizer_stacktrace.cc \
sanitizer_stacktrace_libcdep.cc \
sanitizer_stacktrace_printer.cc \
sanitizer_suppressions.cc \
sanitizer_symbolizer.cc \
sanitizer_symbolizer_libbacktrace.cc \
sanitizer_symbolizer_libcdep.cc \
sanitizer_symbolizer_posix_libcdep.cc
INC_DIR += $(SANITIZER_DIR)
vpath %.cc $(SANITIZER_DIR)/sanitizer_common
SHARED_LIB = yes
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,24 @@
SANITIZER_PORT_DIR := $(call select_from_ports,sanitizer)
SANITIZER_DIR := $(SANITIZER_PORT_DIR)/src/lib/sanitizer
SRC_CC = ubsan_diag.cc \
ubsan_flags.cc \
ubsan_handlers.cc \
ubsan_handlers_cxx.cc \
ubsan_init.cc \
ubsan_type_hash.cc \
ubsan_type_hash_itanium.cc \
ubsan_value.cc
CC_OPT += -DCAN_SANITIZE_UB=1
LIBS += libsanitizer_common
INC_DIR += $(SANITIZER_DIR)
vpath %.cc $(SANITIZER_DIR)/ubsan
SHARED_LIB = yes
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,293 @@
_Z14sanitizer_initRN6Genode3EnvE T
_ZN11__sanitizer10ExtractIntEPKcS1_Pi T
_ZN11__sanitizer10FileExistsEPKc T
_ZN11__sanitizer10FlagParser10ll_strndupEPKcm T
_ZN11__sanitizer10FlagParser10parse_flagEv T
_ZN11__sanitizer10FlagParser11ParseStringEPKc T
_ZN11__sanitizer10FlagParser11fatal_errorEPKc T
_ZN11__sanitizer10FlagParser11parse_flagsEv T
_ZN11__sanitizer10FlagParser11run_handlerEPKcS2_ T
_ZN11__sanitizer10FlagParser15RegisterHandlerEPKcPNS_15FlagHandlerBaseES2_ T
_ZN11__sanitizer10FlagParser15skip_whitespaceEv T
_ZN11__sanitizer10FlagParser21PrintFlagDescriptionsEv T
_ZN11__sanitizer10FlagParser5AllocE B 16
_ZN11__sanitizer10FlagParser8is_spaceEc T
_ZN11__sanitizer10FlagParser9ParseFileEPKcb T
_ZN11__sanitizer10FlagParserC1Ev T
_ZN11__sanitizer10FlagParserC2Ev T
_ZN11__sanitizer10RenameFileEPKcS1_Pi T
_ZN11__sanitizer10ReportFile13SetReportPathEPKc T
_ZN11__sanitizer10ReportFile14SupportsColorsEv T
_ZN11__sanitizer10ReportFile17ReopenIfNecessaryEv T
_ZN11__sanitizer10ReportFile5WriteEPKcm T
_ZN11__sanitizer10StackTrace12GetCurrentPcEv T
_ZN11__sanitizer10StackTrace20GetNextInstructionPcEm T
_ZN11__sanitizer10Symbolizer11SymbolizePCEm T
_ZN11__sanitizer10Symbolizer11symbolizer_E B 8
_ZN11__sanitizer10Symbolizer12PlatformInitEv T
_ZN11__sanitizer10Symbolizer13SymbolizeDataEmPNS_8DataInfoE T
_ZN11__sanitizer10Symbolizer15ModuleNameOwner12GetOwnedCopyEPKc T
_ZN11__sanitizer10Symbolizer15SymbolizerScopeC1EPKS0_ T
_ZN11__sanitizer10Symbolizer15SymbolizerScopeC2EPKS0_ T
_ZN11__sanitizer10Symbolizer15SymbolizerScopeD1Ev T
_ZN11__sanitizer10Symbolizer15SymbolizerScopeD2Ev T
_ZN11__sanitizer10Symbolizer16PlatformDemangleEPKc T
_ZN11__sanitizer10Symbolizer20FindModuleForAddressEm T
_ZN11__sanitizer10Symbolizer20PrepareForSandboxingEv T
_ZN11__sanitizer10Symbolizer21symbolizer_allocator_E B 16
_ZN11__sanitizer10Symbolizer27GetModuleNameAndOffsetForPCEmPPKcPm T
_ZN11__sanitizer10Symbolizer28PlatformPrepareForSandboxingEv T
_ZN11__sanitizer10Symbolizer33FindModuleNameAndOffsetForAddressEmPPKcPm T
_ZN11__sanitizer10Symbolizer5FlushEv T
_ZN11__sanitizer10Symbolizer8AddHooksEPFvvES2_ T
_ZN11__sanitizer10Symbolizer8DemangleEPKc T
_ZN11__sanitizer10Symbolizer8init_mu_E B 1
_ZN11__sanitizer10Symbolizer9GetOrInitEv T
_ZN11__sanitizer10SymbolizerC1ENS_13IntrusiveListINS_14SymbolizerToolEEE T
_ZN11__sanitizer10SymbolizerC2ENS_13IntrusiveListINS_14SymbolizerToolEEE T
_ZN11__sanitizer10UnbundlePcEm T
_ZN11__sanitizer10UnmapOrDieEPvm T
_ZN11__sanitizer11AddressInfo14FillModuleInfoEPKcm T
_ZN11__sanitizer11AddressInfo5ClearEv T
_ZN11__sanitizer11AddressInfoC1Ev T
_ZN11__sanitizer11AddressInfoC2Ev T
_ZN11__sanitizer11CheckFailedEPKciS1_yy T
_ZN11__sanitizer11CommonFlags11SetDefaultsEv T
_ZN11__sanitizer11CommonFlags8CopyFromERKS0_ T
_ZN11__sanitizer11ExtractUptrEPKcS1_Pm T
_ZN11__sanitizer11GetPageSizeEv T
_ZN11__sanitizer11RenderFrameEPNS_20InternalScopedStringEPKciRKNS_11AddressInfoEbS3_S3_ T
_ZN11__sanitizer11WriteToFileEiPKvmPmPi T
_ZN11__sanitizer11mem_is_zeroEPKcm T
_ZN11__sanitizer11report_fileE D 8216
_ZN11__sanitizer12CovAfterForkEi T
_ZN11__sanitizer12CoverageData10BeforeForkEv T
_ZN11__sanitizer12CoverageData10DirectOpenEv T
_ZN11__sanitizer12CoverageData11DumpOffsetsEv T
_ZN11__sanitizer12CoverageData12DumpAsBitSetEv T
_ZN11__sanitizer12CoverageData12DumpCountersEv T
_ZN11__sanitizer12CoverageData16InitializeGuardsEPimPKcm T
_ZN11__sanitizer12CoverageData18InitializeCountersEPhm T
_ZN11__sanitizer12CoverageData18ReinitializeGuardsEv T
_ZN11__sanitizer12CoverageData19UpdateModuleNameVecEmmm T
_ZN11__sanitizer12CoverageData20InitializeGuardArrayEPi T
_ZN11__sanitizer12CoverageData21DumpCallerCalleePairsEv T
_ZN11__sanitizer12CoverageData23GetNumberOf8bitCountersEv T
_ZN11__sanitizer12CoverageData39Update8bitCounterBitsetAndClearCountersEPh T
_ZN11__sanitizer12CoverageData3AddEmPj T
_ZN11__sanitizer12CoverageData4InitEv T
_ZN11__sanitizer12CoverageData4dataEv T
_ZN11__sanitizer12CoverageData4sizeEv T
_ZN11__sanitizer12CoverageData6EnableEv T
_ZN11__sanitizer12CoverageData6ExtendEm T
_ZN11__sanitizer12CoverageData6ReInitEv T
_ZN11__sanitizer12CoverageData7DisableEv T
_ZN11__sanitizer12CoverageData7DumpAllEv T
_ZN11__sanitizer12CoverageData9AfterForkEi T
_ZN11__sanitizer12CoverageData9DumpTraceEv T
_ZN11__sanitizer12CoverageData9IndirCallEmmPmm T
_ZN11__sanitizer12ExtractTokenEPKcS1_PPc T
_ZN11__sanitizer12InternalFreeEPvPNS_28SizeClassAllocatorLocalCacheINS_20SizeClassAllocator32ILm0ELy140737488355328ELm0ENS_12SizeClassMapILm17ELm64ELm14EEELm20ENS_15TwoLevelByteMapILy32768ELy4096ENS_20NoOpMapUnmapCallbackEEES6_EEEE T
_ZN11__sanitizer12LoadedModule15addAddressRangeEmmb T
_ZN11__sanitizer12LoadedModule3setEPKcm T
_ZN11__sanitizer12LoadedModule5clearEv T
_ZN11__sanitizer12ReadFromFileEiPvmPmPi T
_ZN11__sanitizer13BlockingMutex11CheckLockedEv T
_ZN11__sanitizer13BlockingMutex4LockEv T
_ZN11__sanitizer13BlockingMutex6UnlockEv T
_ZN11__sanitizer13BlockingMutexC1Ev T
_ZN11__sanitizer13BlockingMutexC2Ev T
_ZN11__sanitizer13CovBeforeForkEv T
_ZN11__sanitizer13InternalAllocEmPNS_28SizeClassAllocatorLocalCacheINS_20SizeClassAllocator32ILm0ELy140737488355328ELm0ENS_12SizeClassMapILm17ELm64ELm14EEELm20ENS_15TwoLevelByteMapILy32768ELy4096ENS_20NoOpMapUnmapCallbackEEES5_EEEE T
_ZN11__sanitizer13StackDepotGetEj T
_ZN11__sanitizer13StackDepotPutENS_10StackTraceE T
_ZN11__sanitizer13TemplateMatchEPKcS1_ T
_ZN11__sanitizer13unknown_flagsE B 168
_ZN11__sanitizer14AddDieCallbackEPFvvE T
_ZN11__sanitizer14DemangleCXXABIEPKc T
_ZN11__sanitizer14DumpProcessMapEv T
_ZN11__sanitizer14GetProcessNameEv T
_ZN11__sanitizer14IsAbsolutePathEPKc T
_ZN11__sanitizer14LLVMSymbolizer11SendCommandEbPKcm T
_ZN11__sanitizer14LLVMSymbolizer11SymbolizePCEmPNS_15SymbolizedStackE T
_ZN11__sanitizer14LLVMSymbolizer13SymbolizeDataEmPNS_8DataInfoE T
_ZN11__sanitizer14LLVMSymbolizerC1EPKcPNS_17LowLevelAllocatorE T
_ZN11__sanitizer14LLVMSymbolizerC2EPKcPNS_17LowLevelAllocatorE T
_ZN11__sanitizer14ReadBinaryNameEPcm T
_ZN11__sanitizer14SleepForMillisEi T
_ZN11__sanitizer14internal__exitEi T
_ZN11__sanitizer14internal_atollEPKc T
_ZN11__sanitizer14report_file_muE B 1
_ZN11__sanitizer15CacheBinaryNameEv T
_ZN11__sanitizer15ColorizeReportsEv T
_ZN11__sanitizer15IsPathSeparatorEc T
_ZN11__sanitizer15StripModuleNameEPKc T
_ZN11__sanitizer15StripPathPrefixEPKcS1_ T
_ZN11__sanitizer15SymbolizedStack3NewEm T
_ZN11__sanitizer15SymbolizedStack8ClearAllEv T
_ZN11__sanitizer15SymbolizedStackC1Ev T
_ZN11__sanitizer15SymbolizedStackC2Ev T
_ZN11__sanitizer15UnbundleCounterEm T
_ZN11__sanitizer15internal_getpidEv T
_ZN11__sanitizer15internal_memchrEPKvim T
_ZN11__sanitizer15internal_memcmpEPKvS1_m T
_ZN11__sanitizer15internal_memcpyEPvPKvm T
_ZN11__sanitizer15internal_memsetEPvim T
_ZN11__sanitizer15internal_strchrEPKci T
_ZN11__sanitizer15internal_strcmpEPKcS1_ T
_ZN11__sanitizer15internal_strdupEPKc T
_ZN11__sanitizer15internal_strlenEPKc T
_ZN11__sanitizer15internal_strstrEPKcS1_ T
_ZN11__sanitizer16Addr2LineProcess18output_terminator_E R 9
_ZN11__sanitizer16BackgroundThreadEPv T
_ZN11__sanitizer16CovUpdateMappingEPKcm T
_ZN11__sanitizer16FindPathToBinaryEPKc T
_ZN11__sanitizer16GetListOfModulesEPNS_12LoadedModuleEmPFbPKcE T
_ZN11__sanitizer16MaybeOpenCovFileEPKc T
_ZN11__sanitizer16MmapAlignedOrDieEmmPKc T
_ZN11__sanitizer16MprotectNoAccessEmm T
_ZN11__sanitizer16ReadFileToBufferEPKcPPcPmS4_mPi T
_ZN11__sanitizer16StackDepotHandle20inc_use_count_unsafeEv T
_ZN11__sanitizer16StackDepotHandle2idEv T
_ZN11__sanitizer16StackDepotHandle9use_countEv T
_ZN11__sanitizer16internal_iserrorEmPi T
_ZN11__sanitizer16internal_memmoveEPvPKvm T
_ZN11__sanitizer16internal_memrchrEPKvim T
_ZN11__sanitizer16internal_strcspnEPKcS1_ T
_ZN11__sanitizer16internal_strncatEPcPKcm T
_ZN11__sanitizer16internal_strncmpEPKcS1_m T
_ZN11__sanitizer16internal_strncpyEPcPKcm T
_ZN11__sanitizer16internal_strndupEPKcm T
_ZN11__sanitizer16internal_strnlenEPKcm T
_ZN11__sanitizer16internal_strrchrEPKci T
_ZN11__sanitizer17DecreaseTotalMmapEm T
_ZN11__sanitizer17GetPageSizeCachedEv T
_ZN11__sanitizer17IncreaseTotalMmapEm T
_ZN11__sanitizer17LowLevelAllocator8AllocateEm T
_ZN11__sanitizer17RemoveDieCallbackEPFvvE T
_ZN11__sanitizer17SanitizerToolNameE D 8
_ZN11__sanitizer17StackDepotLockAllEv T
_ZN11__sanitizer17SymbolizerProcess11SendCommandEPKc T
_ZN11__sanitizer17SymbolizerProcess15SendCommandImplEPKc T
_ZN11__sanitizer17SymbolizerProcess17WriteToSymbolizerEPKcm T
_ZN11__sanitizer17SymbolizerProcess18ReadFromSymbolizerEPcm T
_ZN11__sanitizer17SymbolizerProcess25StartSymbolizerSubprocessEv T
_ZN11__sanitizer17SymbolizerProcess7RestartEv T
_ZN11__sanitizer17SymbolizerProcessC1EPKcb T
_ZN11__sanitizer17SymbolizerProcessC2EPKcb T
_ZN11__sanitizer17UpdateProcessNameEv T
_ZN11__sanitizer17current_verbosityE B 4
_ZN11__sanitizer17flag_descriptionsE B 24
_ZN11__sanitizer17internal_snprintfEPcmPKcz T
_ZN11__sanitizer18BufferedStackTrace14PopStackFramesEm T
_ZN11__sanitizer18BufferedStackTrace15FastUnwindStackEmmmmj T
_ZN11__sanitizer18BufferedStackTrace15LocatePcInTraceEm T
_ZN11__sanitizer18BufferedStackTrace4InitEPKmmm T
_ZN11__sanitizer18BufferedStackTrace6UnwindEjmmPvmmb T
_ZN11__sanitizer18BundlePcAndCounterEmm T
_ZN11__sanitizer18GetMmapGranularityEv T
_ZN11__sanitizer18InitializeCoverageEbPKc T
_ZN11__sanitizer18MmapNoReserveOrDieEmPKc T
_ZN11__sanitizer18ReportErrorSummaryEPKc T
_ZN11__sanitizer18ReportErrorSummaryEPKcPNS_10StackTraceE T
_ZN11__sanitizer18ReportErrorSummaryEPKcRKNS_11AddressInfoE T
_ZN11__sanitizer18SetUserDieCallbackEPFvvE T
_ZN11__sanitizer18StackDepotGetStatsEv T
_ZN11__sanitizer18SuppressionContext10GetMatchedEPNS_18InternalMmapVectorIPNS_11SuppressionEEE T
_ZN11__sanitizer18SuppressionContext13ParseFromFileEPKc T
_ZN11__sanitizer18SuppressionContext5MatchEPKcS2_PPNS_11SuppressionE T
_ZN11__sanitizer18SuppressionContext5ParseEPKc T
_ZN11__sanitizer18SuppressionContextC1EPPKci T
_ZN11__sanitizer18SuppressionContextC2EPPKci T
_ZN11__sanitizer18internal_allocatorEv T
_ZN11__sanitizer18internal_ftruncateEim T
_ZN11__sanitizer18internal_strchrnulEPKci T
_ZN11__sanitizer19ReadLongProcessNameEPcm T
_ZN11__sanitizer19RegisterCommonFlagsEPNS_10FlagParserEPNS_11CommonFlagsE T
_ZN11__sanitizer19StackDepotUnlockAllEv T
_ZN11__sanitizer20InternalScopedString6appendEPKcz T
_ZN11__sanitizer20PrepareForSandboxingEP29__sanitizer_sandbox_arguments T
_ZN11__sanitizer20ReInitializeCoverageEbPKc T
_ZN11__sanitizer20ReadBinaryNameCachedEPcm T
_ZN11__sanitizer20RegisterIncludeFlagsEPNS_10FlagParserEPNS_11CommonFlagsE T
_ZN11__sanitizer20RenderModuleLocationEPNS_20InternalScopedStringEPKcmS3_ T
_ZN11__sanitizer20RenderSourceLocationEPNS_20InternalScopedStringEPKciibS3_ T
_ZN11__sanitizer20StackDepotReverseMap10IdDescPair12IdComparatorERKS1_S3_ T
_ZN11__sanitizer20StackDepotReverseMap3GetEj T
_ZN11__sanitizer20StackDepotReverseMapC1Ev T
_ZN11__sanitizer20StackDepotReverseMapC2Ev T
_ZN11__sanitizer20internal_sched_yieldEv T
_ZN11__sanitizer21CoverageUpdateMappingEv T
_ZN11__sanitizer21SetSandboxingCallbackEPFvvE T
_ZN11__sanitizer21SupportsColoredOutputEi T
_ZN11__sanitizer21common_flags_dont_useE B 168
_ZN11__sanitizer22LibbacktraceSymbolizer11SymbolizePCEmPNS_15SymbolizedStackE T
_ZN11__sanitizer22LibbacktraceSymbolizer13SymbolizeDataEmPNS_8DataInfoE T
_ZN11__sanitizer22LibbacktraceSymbolizer3getEPNS_17LowLevelAllocatorE T
_ZN11__sanitizer22LibbacktraceSymbolizer8DemangleEPKc T
_ZN11__sanitizer22ParseSymbolizePCOutputEPKcPNS_15SymbolizedStackE T
_ZN11__sanitizer22SetCheckFailedCallbackEPFvPKciS1_yyE T
_ZN11__sanitizer22thePersistentAllocatorE B 24
_ZN11__sanitizer23CovPrepareForSandboxingEP29__sanitizer_sandbox_arguments T
_ZN11__sanitizer23IsAccessibleMemoryRangeEmm T
_ZN11__sanitizer23MapWritableFileToMemoryEPvmim T
_ZN11__sanitizer23ReportMmapFailureAndDieEmPKcS1_i T
_ZN11__sanitizer23ReportUnrecognizedFlagsEv T
_ZN11__sanitizer23internal_simple_strtollEPKcPPci T
_ZN11__sanitizer23stoptheworld_tracer_pidE B 8
_ZN11__sanitizer24ParseSymbolizeDataOutputEPKcPNS_8DataInfoE T
_ZN11__sanitizer24StackDepotPut_WithHandleENS_10StackTraceE T
_ZN11__sanitizer24internal_bzero_aligned16EPvm T
_ZN11__sanitizer24stoptheworld_tracer_ppidE B 8
_ZN11__sanitizer25ExtractTokenUpToDelimiterEPKcS1_PPc T
_ZN11__sanitizer25MaybeStartBackgroudThreadEv T
_ZN11__sanitizer26CommonSanitizerReportMutexE B 1
_ZN11__sanitizer26SetPrintfAndReportCallbackEPFvPKcE T
_ZN11__sanitizer27SetLowLevelAllocateCallbackEPFvmmE T
_ZN11__sanitizer31ReportAllocatorCannotReturnNullEv T
_ZN11__sanitizer31SetSoftRssLimitExceededCallbackEPFvbE T
_ZN11__sanitizer35CallocShouldReturnNullDueToOverflowEmm T
_ZN11__sanitizer3DieEv T
_ZN11__sanitizer5AbortEv T
_ZN11__sanitizer6AtexitEPFvvE T
_ZN11__sanitizer6GetEnvEPKc T
_ZN11__sanitizer6GetRSSEv T
_ZN11__sanitizer6PrintfEPKcz T
_ZN11__sanitizer6ReportEPKcz T
_ZN11__sanitizer7OnPrintEPKc T
_ZN11__sanitizer8DataInfo5ClearEv T
_ZN11__sanitizer8DataInfoC1Ev T
_ZN11__sanitizer8DataInfoC2Ev T
_ZN11__sanitizer8OpenFileEPKcNS_14FileAccessModeEPi T
_ZN11__sanitizer8RawWriteEPKc T
_ZN11__sanitizer9CloseFileEi T
_ZN11__sanitizer9MmapOrDieEmPKc T
_ZN11__sanitizer9SortArrayEPmm T
_ZN11__sanitizer9VSNPrintfEPciPKcP13__va_list_tag T
_ZNK11__sanitizer10StackTrace5PrintEv T
_ZNK11__sanitizer12LoadedModule15containsAddressEm T
_ZNK11__sanitizer16Addr2LineProcess18ReachedEndOfOutputEPKcm T
_ZNK11__sanitizer18SuppressionContext13SuppressionAtEm T
_ZNK11__sanitizer18SuppressionContext16SuppressionCountEv T
_ZNK11__sanitizer18SuppressionContext18HasSuppressionTypeEPKc T
__sanitizer_cov T
__sanitizer_cov_dump T
__sanitizer_cov_indir_call16 T
__sanitizer_cov_init T
__sanitizer_cov_module_init T
__sanitizer_cov_trace_basic_block T
__sanitizer_cov_trace_cmp W
__sanitizer_cov_trace_func_enter T
__sanitizer_cov_trace_switch W
__sanitizer_cov_with_check T
__sanitizer_get_coverage_guards T
__sanitizer_get_number_of_counters T
__sanitizer_get_total_unique_caller_callee_pairs T
__sanitizer_get_total_unique_coverage T
__sanitizer_maybe_open_cov_file T
__sanitizer_report_error_summary W
__sanitizer_reset_coverage T
__sanitizer_sandbox_on_notify W
__sanitizer_set_death_callback T
__sanitizer_set_report_path T
__sanitizer_update_counter_bitset_and_clear_counters T

View File

@ -0,0 +1,63 @@
_ZN7__ubsan11ubsan_flagsE B 24
_ZN7__ubsan12InitAsPluginEv T
_ZN7__ubsan12ScopedReportC1ENS_13ReportOptionsENS_8LocationENS_9ErrorTypeE T
_ZN7__ubsan12ScopedReportC2ENS_13ReportOptionsENS_8LocationENS_9ErrorTypeE T
_ZN7__ubsan12ScopedReportD1Ev T
_ZN7__ubsan12ScopedReportD2Ev T
_ZN7__ubsan14TypeCheckKindsE D 80
_ZN7__ubsan15InitializeFlagsEv T
_ZN7__ubsan16InitAsStandaloneEv T
_ZN7__ubsan16checkDynamicTypeEPvS0_m T
_ZN7__ubsan18RegisterUbsanFlagsEPN11__sanitizer10FlagParserEPNS_5FlagsE T
_ZN7__ubsan21IsVptrCheckSuppressedEPKc T
_ZN7__ubsan21getSymbolizedLocationEm T
_ZN7__ubsan22InitializeSuppressionsEv T
_ZN7__ubsan27InitAsStandaloneIfNecessaryEv T
_ZN7__ubsan28MaybeCallUbsanDefaultOptionsEv T
_ZN7__ubsan28getDynamicTypeInfoFromObjectEPv T
_ZN7__ubsan28getDynamicTypeInfoFromVtableEPv T
_ZN7__ubsan4DiagD1Ev T
_ZN7__ubsan4DiagD2Ev T
_ZN7__ubsan5Flags11SetDefaultsEv T
_ZNK7__ubsan5Value12getSIntValueEv T
_ZNK7__ubsan5Value12getUIntValueEv T
_ZNK7__ubsan5Value13getFloatValueEv T
_ZNK7__ubsan5Value19getPositiveIntValueEv T
__ubsan_default_options W
__ubsan_handle_add_overflow T
__ubsan_handle_add_overflow_abort T
__ubsan_handle_builtin_unreachable T
__ubsan_handle_cfi_bad_icall T
__ubsan_handle_cfi_bad_icall_abort T
__ubsan_handle_cfi_bad_type T
__ubsan_handle_cfi_bad_type_abort T
__ubsan_handle_divrem_overflow T
__ubsan_handle_divrem_overflow_abort T
__ubsan_handle_dynamic_type_cache_miss T
__ubsan_handle_dynamic_type_cache_miss_abort T
__ubsan_handle_float_cast_overflow T
__ubsan_handle_float_cast_overflow_abort T
__ubsan_handle_function_type_mismatch T
__ubsan_handle_function_type_mismatch_abort T
__ubsan_handle_load_invalid_value T
__ubsan_handle_load_invalid_value_abort T
__ubsan_handle_missing_return T
__ubsan_handle_mul_overflow T
__ubsan_handle_mul_overflow_abort T
__ubsan_handle_negate_overflow T
__ubsan_handle_negate_overflow_abort T
__ubsan_handle_nonnull_arg T
__ubsan_handle_nonnull_arg_abort T
__ubsan_handle_nonnull_return T
__ubsan_handle_nonnull_return_abort T
__ubsan_handle_out_of_bounds T
__ubsan_handle_out_of_bounds_abort T
__ubsan_handle_shift_out_of_bounds T
__ubsan_handle_shift_out_of_bounds_abort T
__ubsan_handle_sub_overflow T
__ubsan_handle_sub_overflow_abort T
__ubsan_handle_type_mismatch T
__ubsan_handle_type_mismatch_abort T
__ubsan_handle_vla_bound_not_positive T
__ubsan_handle_vla_bound_not_positive_abort T
__ubsan_vptr_type_cache B 1024

View File

@ -0,0 +1 @@
dfe2eb4e87d06f6ae2d4a36d59128a5b96690654

View File

@ -0,0 +1,15 @@
LICENSE := LGPL
VERSION := 6.3.0
DOWNLOADS := sanitizer.archive
URL(sanitizer) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.bz2
SHA(sanitizer) := f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f
DIR(sanitizer) := src/lib/sanitizer
SIG(sanitizer) := ${URL(gcc)}
KEY(sanitizer) := GNU
TAR_OPT(sanitizer) := gcc-$(VERSION)/libsanitizer \
--strip-components=2
PATCHES := src/lib/sanitizer/*.patch
PATCH_OPT := -p1 -d src/lib/sanitizer

View File

@ -0,0 +1,12 @@
content: lib/symbols/libsanitizer_common \
lib/symbols/libubsan \
LICENSE
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sanitizer)
lib/symbols/%:
$(mirror_from_rep_dir)
LICENSE:
cp $(PORT_DIR)/src/lib/sanitizer/LICENSE.TXT $@

View File

@ -0,0 +1 @@
2018-12-05 79580ecc027b8b9d65a7b6354f9aae8a76d398f4

View File

@ -0,0 +1 @@
sanitizer

View File

@ -0,0 +1,22 @@
MIRROR_FROM_REP_DIR := lib/mk/libsanitizer_common.mk \
lib/mk/libubsan.mk
content: $(MIRROR_FROM_REP_DIR)
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
content: src/lib/sanitizer
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sanitizer)
src/lib/sanitizer:
mkdir -p $@
cp -r $(PORT_DIR)/src/lib/sanitizer/* $@
echo "LIBS = libsanitizer_common libubsan" > $@/target.mk
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/lib/sanitizer/LICENSE.TXT $@

View File

@ -0,0 +1 @@
2018-12-05-b 4505daff3e63877c34f208308f828ff1810caa11

View File

@ -0,0 +1,2 @@
base
so

View File

@ -0,0 +1,573 @@
sanitizer.patch
From: Christian Prochaska <christian.prochaska@genode-labs.com>
---
sanitizer_common/sanitizer_genode.cc | 323 ++++++++++++++++++++
sanitizer_common/sanitizer_internal_defs.h | 6
sanitizer_common/sanitizer_platform.h | 4
sanitizer_common/sanitizer_printf.cc | 2
sanitizer_common/sanitizer_stacktrace.h | 2
sanitizer_common/sanitizer_symbolizer_libcdep.cc | 5
.../sanitizer_symbolizer_posix_libcdep.cc | 20 +
ubsan/ubsan_diag.cc | 4
ubsan/ubsan_type_hash_itanium.cc | 2
9 files changed, 357 insertions(+), 11 deletions(-)
create mode 100644 sanitizer_common/sanitizer_genode.cc
diff --git a/sanitizer_common/sanitizer_genode.cc b/sanitizer_common/sanitizer_genode.cc
new file mode 100644
index 0000000..b16dc5d
--- /dev/null
+++ b/sanitizer_common/sanitizer_genode.cc
@@ -0,0 +1,323 @@
+/*
+ * \brief Genode-specific functions from sanitizer_common.h
+ * and sanitizer_libc.h
+ * \author Christian Prochaska
+ * \date 2018-12-05
+ */
+
+/*
+ * Copyright (C) 2018 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU Affero General Public License version 3.
+ */
+
+#include <base/env.h>
+#include <base/heap.h>
+#include <base/log.h>
+#include <base/printf.h>
+
+#include "sanitizer_platform.h"
+
+#include "sanitizer_common.h"
+
+
+extern int genode_atexit(void (*func)(void));
+extern void genode_exit(int) __attribute__((noreturn));
+
+
+static constexpr bool verbose = false;
+
+
+struct Sanitizer_env
+{
+ Genode::Env &env;
+ Genode::Heap heap { env.ram(), env.rm() };
+
+ Sanitizer_env(Genode::Env &env) : env(env) { }
+};
+
+
+static Genode::Constructible<Sanitizer_env> sanitizer_env;
+
+
+void sanitizer_init(Genode::Env &env)
+{
+ sanitizer_env.construct(env);
+}
+
+
+/* sanitizer_common.h */
+
+
+void __sanitizer::Abort()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ genode_exit(-1);
+}
+
+
+int __sanitizer::Atexit(void (*function)(void))
+{
+ return genode_atexit(function);
+}
+
+
+bool __sanitizer::SupportsColoredOutput(fd_t fd)
+{
+ if (fd == 2)
+ return true;
+ else
+ return false;
+}
+
+
+bool __sanitizer::IsAccessibleMemoryRange(uptr beg, uptr size)
+{
+ if (verbose)
+ Genode::error("sanitizer: ", __func__, " called");
+ return true;
+}
+
+
+void __sanitizer::PrepareForSandboxing(__sanitizer_sandbox_arguments *args)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+bool __sanitizer::FileExists(const char *filename)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return false;
+}
+
+
+const char *__sanitizer::GetEnv(const char *name)
+{
+ if (verbose)
+ Genode::log("sanitizer: ", __func__,
+ ": ", Genode::Cstring(name));
+ return nullptr;
+}
+
+
+__sanitizer::BlockingMutex::BlockingMutex()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ internal_memset(this, 0, sizeof(*this));
+}
+
+
+void __sanitizer::BlockingMutex::Lock()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+void __sanitizer::BlockingMutex::Unlock()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+void __sanitizer::BlockingMutex::CheckLocked()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+uptr __sanitizer::internal_getpid()
+{
+ return 0;
+}
+
+
+uptr __sanitizer::GetPageSize()
+{
+ if (verbose)
+ Genode::warning("sanitizer: ", __func__, " called, returning 4096");
+ return 4096;
+}
+
+
+uptr __sanitizer::ReadBinaryName(char *buf, uptr buf_len)
+{
+ return internal_snprintf(buf, buf_len, "binary");
+}
+
+
+uptr __sanitizer::ReadLongProcessName(char *buf, uptr buf_len)
+{
+ internal_strncpy(buf, "process", buf_len);
+ return internal_strlen(buf);
+}
+
+
+uptr __sanitizer::GetMmapGranularity()
+{
+ return GetPageSize();
+}
+
+
+void *__sanitizer::MmapOrDie(uptr size, const char *mem_type)
+{
+ size = RoundUpTo(size, GetPageSizeCached());
+
+ void *res = nullptr;
+ sanitizer_env->heap.alloc(size, &res);
+
+ if (res == nullptr)
+ ReportMmapFailureAndDie(size, mem_type, "allocate", 0);
+
+ IncreaseTotalMmap(size);
+ return res;
+}
+
+
+void __sanitizer::UnmapOrDie(void *addr, uptr size)
+{
+ if (!addr || !size) return;
+
+ sanitizer_env->heap.free(addr, size);
+
+ DecreaseTotalMmap(size);
+}
+
+
+void *__sanitizer::MmapNoReserveOrDie(uptr size, const char *mem_type)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return nullptr;
+}
+
+
+bool __sanitizer::MprotectNoAccess(uptr addr, uptr size)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return false;
+}
+
+
+uptr __sanitizer::GetRSS()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return 0;
+}
+
+
+fd_t __sanitizer::OpenFile(const char *filename,
+ FileAccessMode mode,
+ error_t *errno_p)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return kInvalidFd;
+}
+
+
+void __sanitizer::CloseFile(fd_t fd)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+bool __sanitizer::ReadFromFile(fd_t fd, void *buff, uptr buff_size,
+ uptr *bytes_read, error_t *error_p)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return false;
+}
+
+
+bool __sanitizer::WriteToFile(fd_t fd, const void *buff, uptr buff_size,
+ uptr *bytes_written, error_t *error_p)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return true;
+}
+
+
+bool __sanitizer::RenameFile(const char *oldpath, const char *newpath,
+ error_t *error_p)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return false;
+}
+
+
+void *__sanitizer::MapWritableFileToMemory(void *addr, uptr size, fd_t fd,
+ OFF_T offset)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return nullptr;
+}
+
+
+void __sanitizer::DumpProcessMap()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+bool __sanitizer::IsPathSeparator(const char c)
+{
+ return c == '/';
+}
+
+
+bool __sanitizer::IsAbsolutePath(const char *path)
+{
+ return path != nullptr && IsPathSeparator(path[0]);
+}
+
+
+void __sanitizer::ReportFile::Write(const char *buffer, uptr length)
+{
+ SpinMutexLock l(mu);
+ Genode::printf("%s", buffer);
+}
+
+
+void __sanitizer::SleepForMillis(int millis)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+}
+
+
+uptr __sanitizer::GetListOfModules(LoadedModule *modules, uptr max_modules,
+ string_predicate_t filter)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return 0;
+}
+
+
+/* sanitizer_libc.h */
+
+
+uptr __sanitizer::internal_sched_yield()
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return 0;
+}
+
+
+uptr __sanitizer::internal_ftruncate(fd_t fd, uptr size)
+{
+ Genode::error("sanitizer: ", __func__, " called");
+ return 0;
+}
+
+
+void __sanitizer::internal__exit(int exitcode)
+{
+ genode_exit(exitcode);
+}
+
+
+bool __sanitizer::internal_iserror(uptr retval, int *rverrno)
+{
+ Genode::warning("sanitizer: ", __func__,
+ " called, returning false");
+ return false;
+}
diff --git a/sanitizer_common/sanitizer_internal_defs.h b/sanitizer_common/sanitizer_internal_defs.h
index d76ed75..bab2fdc 100644
--- a/sanitizer_common/sanitizer_internal_defs.h
+++ b/sanitizer_common/sanitizer_internal_defs.h
@@ -13,6 +13,8 @@
#include "sanitizer_platform.h"
+#include <stddef.h>
+
#ifndef SANITIZER_DEBUG
# define SANITIZER_DEBUG 0
#endif
@@ -101,9 +103,9 @@ typedef uptr OFF_T;
typedef u64 OFF64_T;
#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
-typedef uptr operator_new_size_type;
+typedef size_t operator_new_size_type;
#else
-typedef u32 operator_new_size_type;
+typedef size_t operator_new_size_type;
#endif
} // namespace __sanitizer
diff --git a/sanitizer_common/sanitizer_platform.h b/sanitizer_common/sanitizer_platform.h
index 7d0ff28..e096ee9 100644
--- a/sanitizer_common/sanitizer_platform.h
+++ b/sanitizer_common/sanitizer_platform.h
@@ -11,10 +11,12 @@
#ifndef SANITIZER_PLATFORM_H
#define SANITIZER_PLATFORM_H
+#if 0
#if !defined(__linux__) && !defined(__FreeBSD__) && \
!defined(__APPLE__) && !defined(_WIN32)
# error "This operating system is not supported"
#endif
+#endif
#if defined(__linux__)
# define SANITIZER_LINUX 1
@@ -59,7 +61,7 @@
# define SANITIZER_ANDROID 0
#endif
-#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC)
+#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || 1)
#if __LP64__ || defined(_WIN64)
# define SANITIZER_WORDSIZE 64
diff --git a/sanitizer_common/sanitizer_printf.cc b/sanitizer_common/sanitizer_printf.cc
index 6688610..6efd98b 100644
--- a/sanitizer_common/sanitizer_printf.cc
+++ b/sanitizer_common/sanitizer_printf.cc
@@ -16,7 +16,9 @@
#include "sanitizer_flags.h"
#include "sanitizer_libc.h"
+#if 0
#include <stdio.h>
+#endif
#include <stdarg.h>
#if SANITIZER_WINDOWS && defined(_MSC_VER) && _MSC_VER < 1800 && \
diff --git a/sanitizer_common/sanitizer_stacktrace.h b/sanitizer_common/sanitizer_stacktrace.h
index 7f22455..d16d758 100644
--- a/sanitizer_common/sanitizer_stacktrace.h
+++ b/sanitizer_common/sanitizer_stacktrace.h
@@ -31,7 +31,7 @@ static const u32 kStackTraceMax = 256;
#if SANITIZER_MAC
# define SANITIZER_CAN_SLOW_UNWIND 0
#else
-# define SANITIZER_CAN_SLOW_UNWIND 1
+# define SANITIZER_CAN_SLOW_UNWIND 0
#endif
struct StackTrace {
diff --git a/sanitizer_common/sanitizer_symbolizer_libcdep.cc b/sanitizer_common/sanitizer_symbolizer_libcdep.cc
index 4264b5e..52fc18d 100644
--- a/sanitizer_common/sanitizer_symbolizer_libcdep.cc
+++ b/sanitizer_common/sanitizer_symbolizer_libcdep.cc
@@ -9,6 +9,8 @@
// run-time libraries.
//===----------------------------------------------------------------------===//
+#include <base/log.h>
+
#include "sanitizer_allocator_internal.h"
#include "sanitizer_internal_defs.h"
#include "sanitizer_symbolizer_internal.h"
@@ -146,6 +148,8 @@ bool Symbolizer::FindModuleNameAndOffsetForAddress(uptr address,
}
LoadedModule *Symbolizer::FindModuleForAddress(uptr address) {
+ Genode::error("sanitizer: ", __func__, " called");
+#if 0
bool modules_were_reloaded = false;
if (!modules_fresh_) {
for (uptr i = 0; i < n_modules_; i++)
@@ -170,6 +174,7 @@ LoadedModule *Symbolizer::FindModuleForAddress(uptr address) {
modules_fresh_ = false;
return FindModuleForAddress(address);
}
+#endif
return 0;
}
diff --git a/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc b/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
index e4ff525..793cbb1 100644
--- a/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
+++ b/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
@@ -10,6 +10,9 @@
// POSIX-specific implementation of symbolizer parts.
//===----------------------------------------------------------------------===//
+#include <base/log.h>
+#include <stddef.h>
+
#include "sanitizer_platform.h"
#if SANITIZER_POSIX
#include "sanitizer_allocator_internal.h"
@@ -23,12 +26,12 @@
#include "sanitizer_symbolizer_internal.h"
#include "sanitizer_symbolizer_libbacktrace.h"
#include "sanitizer_symbolizer_mac.h"
-
+#if 0
#include <errno.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
-
+#endif
#if SANITIZER_MAC
#include <util.h> // for forkpty()
#endif // SANITIZER_MAC
@@ -60,6 +63,10 @@ const char *DemangleCXXABI(const char *name) {
}
bool SymbolizerProcess::StartSymbolizerSubprocess() {
+ Genode::error("sanitizer: ", __func__, " called");
+ return false;
+
+#if 0
if (!FileExists(path_)) {
if (!reported_invalid_path_) {
Report("WARNING: invalid path to external symbolizer!\n");
@@ -182,6 +189,7 @@ bool SymbolizerProcess::StartSymbolizerSubprocess() {
}
return true;
+#endif
}
class Addr2LineProcess : public SymbolizerProcess {
@@ -376,7 +384,7 @@ const char *Symbolizer::PlatformDemangle(const char *name) {
}
void Symbolizer::PlatformPrepareForSandboxing() {}
-
+#if 0
static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
const char *path = common_flags()->external_symbolizer_path;
const char *binary_name = path ? StripModuleName(path) : "";
@@ -424,7 +432,7 @@ static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
}
return nullptr;
}
-
+#endif
static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,
LowLevelAllocator *allocator) {
if (!common_flags()->symbolize) {
@@ -441,11 +449,11 @@ static void ChooseSymbolizerTools(IntrusiveList<SymbolizerTool> *list,
list->push_back(tool);
return;
}
-
+#if 0
if (SymbolizerTool *tool = ChooseExternalSymbolizer(allocator)) {
list->push_back(tool);
}
-
+#endif
#if SANITIZER_MAC
VReport(2, "Using dladdr symbolizer.\n");
list->push_back(new(*allocator) DlAddrSymbolizer());
diff --git a/ubsan/ubsan_diag.cc b/ubsan/ubsan_diag.cc
index 1197f83..8ffa8fe 100644
--- a/ubsan/ubsan_diag.cc
+++ b/ubsan/ubsan_diag.cc
@@ -20,7 +20,9 @@
#include "sanitizer_common/sanitizer_stacktrace_printer.h"
#include "sanitizer_common/sanitizer_suppressions.h"
#include "sanitizer_common/sanitizer_symbolizer.h"
+#if 0
#include <stdio.h>
+#endif
using namespace __ubsan;
@@ -204,8 +206,10 @@ static void renderText(const char *Message, const Diag::Arg *Args) {
#if SANITIZER_WINDOWS
sprintf_s(Buffer, sizeof(Buffer), "%Lg", (long double)A.Float);
#else
+#if 0
snprintf(Buffer, sizeof(Buffer), "%Lg", (long double)A.Float);
#endif
+#endif
Printf("%s", Buffer);
break;
}
diff --git a/ubsan/ubsan_type_hash_itanium.cc b/ubsan/ubsan_type_hash_itanium.cc
index e4f1334..57e78cd 100644
--- a/ubsan/ubsan_type_hash_itanium.cc
+++ b/ubsan/ubsan_type_hash_itanium.cc
@@ -113,7 +113,7 @@ static __ubsan::HashValue *getTypeCacheHashTableBucket(__ubsan::HashValue V) {
static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived,
const abi::__class_type_info *Base,
sptr Offset) {
- if (Derived->__type_name == Base->__type_name)
+ if (internal_strcmp(Derived->__type_name, Base->__type_name) == 0)
return Offset == 0;
if (const abi::__si_class_type_info *SI =