Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shmctl error return #78

Merged
merged 6 commits into from
Oct 19, 2023
Merged

Fix shmctl error return #78

merged 6 commits into from
Oct 19, 2023

Conversation

Yaxuan-w
Copy link
Member

@Yaxuan-w Yaxuan-w commented Oct 10, 2023

Description

Fixes #317

Type of change

As cmd is set to IPC_STAT, shmctl should return errno=EFAULT when the address pointed to by buf isn't accessible.
Before modification, lind will display *** signal 11..., and after repair, it will return to err=14 normally.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Run /lind/lind_project/tests/testcases/testshmctl.c

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-project, safeposix-rust)

@yizhuoliang
Copy link

yizhuoliang commented Oct 16, 2023

A breif note, I checked the normal glibc code where if the buf is null, it still return the call to shmctl syscall using buf as an parameter, this means if buf is null, it will eventually return an error. So, yeah, I think this modification makes sense, and is in align with original glibc.

@rennergade rennergade merged commit b277e34 into develop Oct 19, 2023
rennergade added a commit that referenced this pull request Feb 27, 2024
* adding fchmod to glibc (#62)

Co-authored-by: lind <lind@nyu.edu>

* Libc xid faking (#63)

* umask all

* umask all

* umask all

* umask all

* umask all

* umask all

* chown

* setgid/uid

* setuid test

* setuid test

* setuid test

* setuid test

* setuid test

* setuid test

* setuid test

* comments

* comments

* comments

* Removed unused lind_lock stuff, made mutex impl more sane (#64)

* Removed unused lind_lock stuff, made mutex impl more sane

* Added space between if and parens

* Added in truncate and ftruncate system calls (#65)

* Added Mknod and Fchdir (#68)

Co-authored-by: lind <lind@nyu.edu>

* Removing mknod syscall (#70)

* Added Mknod and Fchdir

* Remove mknod Syscall

---------

Co-authored-by: lind <lind@nyu.edu>

* fix errno link/unlink/poll (#71)

* fix errno link/unlink/poll

* fix errno open

* fix errno open

* fix errno open

* Fixed libc errno returns (#72)

* fix socket/bind/listen/connect/send/sendto/recv

* fix renmae/mkdir/rmdir/close/fstatfs/statfs/access/truncate/ftruncate

* fix stat/fstat/lstat/rmdir

* Fix libc errno returns (#74)

* fix epoll_ctl/epoll_create/epoll_wait

* fix epoll

* fix epoll

* fix gpn

* fix getpeer/getsockname/get-setsockopt

* fix sendto/shutdown

* Fix libc errno returns (#75)

* fix read/write/pread/pwrite/seek

* fix write

* fix getifaddrs

* Semaphores (#76)

* attempt irt.h

* add sempost

* add sempost

* add sempost

* add other signatures

* add other signatures

* add other signatures

* add semwait seminit

* add other semfuncs

* add other semfuncs

* add other semfuncs

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* add irt.h

* Lseek revert (#77)

* revert lseek

* revert lseek

* Fix shmctl error return (#78)

* add ptr check IPC_STAT

* check nacl_buf

* check nacl_buf

* check nacl_buf

* check nacl_buf

* check nacl_buf

* Fix libc errno returns (#79)

* update shmdt/shmctl/munmap/mprotect

* Remove blank file

* Adding fdatasync and fsync system calls (#81)

* Adding fsync

* Adding fdatasync

---------

Co-authored-by: lind <lind@nyu.edu>

* Adding sync_file_range Syscall (#82)

* Adding fsync

* Adding fdatasync

* Adding sync_file_range

* Change as an off_t

* Necessary changes for sync_file_range

* Update sysdep.h

* Update sysdep.h

* Update irt_syscalls.c

---------

Co-authored-by: lind <lind@nyu.edu>

* Signals (#80)

* [WIP]Add sigaction syscall

* Fix weak alias in sigaction.c

* Remove stub warning

* Fix errno

* Add kill syscall

* Fix weak alias

* Convert struct sigaction to struct nacl_abi_sigaction

* Cast sa_handler to and from uint32_t

* Add sigprocmask syscall

* Ensure to cover every signal during conversions between sigset_t and uint64_t

* Disallow blocking SIGKILL and SIGSTOP and add comments

* [WIP]Make sigset in sigaction struct uint64_t(BUGGY)

* Include nacl_sigprocmask.h in sigaction.c

* Combine nacl_sigprocmask.h and nacl_sigaction.h into nacl_signal.h

* Move the definitions of functions converting between sigset_t and uint64_t to sigaction.c

* Convert nacl_oact back to oact only after success result

* Add alarm syscall

* Add lindsetitimer

* Remove redundant code for alarm

* Uncomment stub warning

* Add Sigprocmask Syscall (#66)

* Add sigprocmask syscall

* Ensure to cover every signal during conversions between sigset_t and uint64_t

* Disallow blocking SIGKILL and SIGSTOP and add comments

* [WIP]Make sigset in sigaction struct uint64_t(BUGGY)

* Include nacl_sigprocmask.h in sigaction.c

* Combine nacl_sigprocmask.h and nacl_sigaction.h into nacl_signal.h

* Move the definitions of functions converting between sigset_t and uint64_t to sigaction.c

* Convert nacl_oact back to oact only after success result

* Added entry for signal dispatch

* merge sigalrm

* merge sigalrm

* fix poll errno

* fix define comments

---------

Co-authored-by: lind <lind@nyu.edu>
Co-authored-by: Tian(Maxwell) Yang <maxwell_yang@outlook.com>
Co-authored-by: Tian Yang <31149339+AlpacaMax@users.noreply.github.com>
Co-authored-by: jesings <34111484+jesings@users.noreply.github.com>

---------

Co-authored-by: Justin Koe <100324413+justyoyo123@users.noreply.github.com>
Co-authored-by: lind <lind@nyu.edu>
Co-authored-by: jesings <34111484+jesings@users.noreply.github.com>
Co-authored-by: kuzeyardabulut <54737933+kuzeyardabulut@users.noreply.github.com>
Co-authored-by: Alice W <40227173+Yaxuan-w@users.noreply.github.com>
Co-authored-by: Tian(Maxwell) Yang <maxwell_yang@outlook.com>
Co-authored-by: Tian Yang <31149339+AlpacaMax@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants