-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Description
The following test are failing due to unable to handle invalid pointer. Most of these test fails while trying to dereference and invalid memory address while negative testing, they are unable to do proper pointer validation & the code crashes instead of returning -1
and setting error_value
.
link04:
- In test file calling link(fname1, fname2)) function with fname1 set to invalid pointer is to handle invalid addresses. This failure occurs at winsup/cygwin/path.cc#L715.
Stat03:
- In test file calling stat(file_name, &stat_buf) function with file_name set to invalid pointer is to handle invalid addresses. This failure occurs at winsup/cygwin/path.cc#L715.
Symlink01:
- In test file calling unlink(path2) function with path2 set to invalid pointer is to handle invalid addresses. This failure occurs at winsup/cygwin/path.cc#L715.
Symlink03:
- In test file Calling symlink(test_file,sym_file) with sym_file set to invalid addresses. The flow goes to symlink in winsup/cygwin/path.cc file but due to insufficient pointer validation, the code crashes instead of returning -1 and setting error_value.
Unlink07:
- In test file calling unlink(fname) function with fname set to invalid address. This failure occurs at winsup/cygwin/path.cc#L715.
Stat06:
- In test file calling stat(fname,stbuf) function with fname set to invalid address. This failure occurs at winsup/cygwin/path.cc#L715.
Rmdir05:
- In test file calling rmdir((char )-1) function to handle invalid pointer. The failure occurs at winsup/cygwin/dir.cc file.
Mkdir01:
- In test file calling mkdir((char)-1.0777) function to handle invalid pointer .The invalid pointer flows goes to winsup/cygwin/dir.cc file but due to insufficient pointer validation , the code crashes instead of returning -1 and setting error_value.
Munmap01:
- In test file calling munmap01(addr,map_len) function with addr is invalid pointer. When addr is used to store value it throws access violation.
Munmap02:
- In test file calling munmap02(addr,map_len) with addr is invalid pointer. When addr is used to store value it throws access violation.
Mmap05:
- In test file file_content = addr[0] causes access violation as mmap function is called with PROT_NONE in line no:129.So the test fails to handle this case and throws access violation.
Times02:
- In test file times((void*)-1) is called in line no:82 in times02 file. So this causes access violation at times.cc line no:76.The times() fails to handle this input.
Mmaptest02:
- The test fails at mmap.cc line no:1140.The len virtual address is invalid so the test is failing.
Mmaptest03 :
- In test file buf1 is unmapped at line no:120,so accessing buf1[0] is causing the access violation in line no:126.
Shmtest :
- The test fails at line no:150 , The shm_buf passed to strcpy is invalid so the test fails to handle it.
Rename08:
- In test file line no:135, the second arguemnt is invalid pointer.So it causes access violation in syscalls.cc line no:2287.
Chdir04:
- In test file line no:126, chdir function is called with invalid pointer.So it causes access violation at path.cc file line no:715.
Access03:
- In test file line no:158 ,calling access((char *)-1, R_OK) couldn't be able to handle invalid pointer.so it causes access violation at path.cc line no:715.
Access05:
- In test file line no:175, calling access(file_name, access_mode) couldn't be able to handle invalid pointer.As file_name is set to invalid pointer.so it causes access violation at path.cc line no:715.
Acceptance criteria
- The above mentioned test failures are fixed and they pass while running the
execute-cygwin-tests
script in AArch64 Cygwin build.