smack icon indicating copy to clipboard operation
smack copied to clipboard

memcpy compiles to memcpy_chk, which is not recognized by smack

Open danielsn opened this issue 7 years ago • 2 comments

When I compile the following code, the function memcpy_chk gets inserted, which is not handled properly by SMACK.

#include <string.h>

int test(char* a, char* b, int len)
{
  memcpy(a,b,len);
}
$uname -a
Darwin C02R432HFVH8 15.6.0 Darwin Kernel Version 15.6.0: Mon Nov 13 21:58:35 PST 2017; root:xnu-3248.72.11~1/RELEASE_X86_64 x86_64

$ clang --version
\clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /usr/local/opt/[email protected]/bin

danielsn avatar Jan 09 '18 20:01 danielsn

memcpy_issue.zip

danielsn avatar Jan 09 '18 20:01 danielsn

FYI, we have a similar issue with Rust, where malloc is called je_mallocx. Maybe the names we match should be regular expressions instead of just string constants.

zvonimir avatar Jan 09 '18 21:01 zvonimir