Page MenuHomeFreeBSD

Implement prlimit64() system call.
ClosedPublic

Authored by dchagin on Oct 31 2014, 6:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 4:10 AM
Unknown Object (File)
Wed, Dec 18, 3:22 AM
Unknown Object (File)
Nov 12 2024, 10:18 PM
Unknown Object (File)
Nov 1 2024, 5:45 AM
Unknown Object (File)
Nov 1 2024, 5:13 AM
Unknown Object (File)
Oct 20 2024, 1:23 AM
Unknown Object (File)
Oct 14 2024, 11:52 PM
Unknown Object (File)
Oct 1 2024, 8:28 PM
Subscribers

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

dchagin retitled this revision from to Implement prlimit64() system call..
emaste added a reviewer: emaste.
This revision is now accepted and ready to land.Oct 31 2014, 1:42 PM
dchagin edited edge metadata.

style(9)

This revision now requires review to proceed.Mar 24 2015, 5:51 PM
trasz added inline comments.
sys/amd64/linux32/syscalls.master
558

const? Also, FreeBSD rlim_t is int64, while Linux 'struct rlimit64' seems to have uint64 there.

Same thing below.

dchagin edited edge metadata.

Add a note about rlim signedness.

About const - I would prefer to not use 'const' in masters,
thereto clang complains to discard qualifers in copyout()

I'm wrong, we do not conversion for new limits, but we should convert RLIM_INFINITY.

Erm, what exactly does the clang say? I mean, in copyout(9) declaration there is a "const" for the kernel pointer, so it shouldn't complain about it?

trasz added a reviewer: trasz.

I'd prefer explicit conversion - even if it's just memcpy in one of the directions - but it's ok for now.

This revision is now accepted and ready to land.Mar 27 2015, 11:58 AM
trasz requested changes to this revision.Mar 27 2015, 12:02 PM
trasz edited edge metadata.

Erm, wait. You're missing access check before kern_proc_setrlimit(). I _think_ it should be PGET_CANDEBUG (as opposed to PGET_CANSEE for retrieving limits); that's what sysctl_kern_proc_rlimit() uses.

This revision now requires changes to proceed.Mar 27 2015, 12:02 PM
dchagin edited edge metadata.

Yes, yoa are right! I was thinking why kern_proc_setrlimit()
does not check access. ie, sys_setrlimit.

fixed by copiyng code fro, sysctl code, thnak you very match!

dchagin edited edge metadata.

typo fixed.

sys/compat/linux/linux_misc.c
1986

Does it still do the same thing for PID 0?

This revision was automatically updated to reflect the committed changes.