New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601497 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

allocator_shim_override_cpp_symbols.h nothrow syms should be aliased against 2-arg methods

Project Member Reported by primiano@chromium.org, Apr 7 2016

Issue description

dskiba@ just pointed out:

in allocator_shim_override_cpp_symbols.h I am aliasing
void* operator new(size_t size, std::nothrow_t&) __THROW
against
ShimCppNew(size_t)

but ShimCppNew takes one argument.
So this will work as long as the calling convention is callee-cleaned or args are passed on registers.
I guess I should create a ShimCppNewNothrow and alias that to that one.
Should fix this before doing the windows shim work.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4809ef025d50acb50489134273e13444252a8e6

commit d4809ef025d50acb50489134273e13444252a8e6
Author: pcc <pcc@chromium.org>
Date: Wed Mar 01 11:01:30 2017

allocator: Fix function type mismatch in allocator function definitions.

CL 2697123007 added a context argument to most of the shim allocator
functions. This means that it is no longer valid to define (say) malloc as
an alias of ShimMalloc, because their function types no longer match.

This change defines the allocator functions as real functions that call the
shims passing nullptr as the context.

Found with -fsanitize=cfi-icall.

R=primiano@chromium.org
BUG= 696986 , 601497 

Review-Url: https://codereview.chromium.org/2720703004
Cr-Commit-Position: refs/heads/master@{#453900}

[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim.cc
[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim_internals.h
[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim_override_cpp_symbols.h
[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim_override_glibc_weak_symbols.h
[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim_override_libc_symbols.h
[modify] https://crrev.com/d4809ef025d50acb50489134273e13444252a8e6/base/allocator/allocator_shim_override_linker_wrapped_symbols.h

Status: Fixed (was: Untriaged)

Sign in to add a comment