Skip to content

Cygwin: Test - Failure [Access Violation] params with invalid Address. #329

@thiru-mcw

Description

@thiru-mcw

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:

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:

Stat06:

Rmdir05:

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:

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:

Chdir04:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions