| Summary: | [PATCH] implementation of the /proc/<pid>/limits file for linprocfs | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Szymon <knight.erraunt> | ||||||||||
| Component: | kern | Assignee: | Dag-Erling Smørgrav <des> | ||||||||||
| Status: | Closed FIXED | ||||||||||||
| Severity: | Affects Only Me | CC: | dchagin, des, knight.erraunt | ||||||||||
| Priority: | --- | Keywords: | patch | ||||||||||
| Version: | CURRENT | Flags: | des:
mfc-stable10?
|
||||||||||
| Hardware: | Any | ||||||||||||
| OS: | Any | ||||||||||||
| Attachments: |
|
||||||||||||
Sorry, Dmitry, this one is mine. A commit references this bug: Author: des Date: Sun Feb 21 14:56:05 UTC 2016 New revision: 295856 URL: https://svnweb.freebsd.org/changeset/base/295856 Log: Implement /proc/$$/limits. PR: 207386 Submitted by: Szymon ?liwa <knight.erraunt@gmail.com> MFC after: 3 weeks Changes: head/sys/compat/linprocfs/linprocfs.c Created attachment 167260 [details]
more complete implementation
i have adapted my own limits implementation over your
(In reply to Dmitry Chagin from comment #3) Well, I got a message from one of the committers that there are some issues - plimit does not need to be allocated dynamically. And actually we should not copy the limits but get a private reference, I also got this link http://fxr.watson.org/fxr/source/fs/procfs/procfs_rlimit.c#L112 so I think that the implementation should conform to what is under the link. Created attachment 167315 [details]
proc lock fix patch
yes, mjg@ pointed proc locking problem. pn_fill methods only prele proc
Created attachment 167814 [details] Fixed the improper access to the process limits Changed the way the code accesses the limits structure. Took inspiration from here: http://fxr.watson.org/fxr/source/fs/procfs/procfs_rlimit.c#L112 . Also changed the name cur_proc_lim to process_lim as I was told the prior may be misleading. (In reply to Dmitry Chagin from comment #5) I also fixed mine code and posted here a patch to comply with the istructions given from the rest. What should we do to commit any of the fixes, I don't mind which one, I would just like if the dangerous code was replaced with something fast. A commit references this bug: Author: dchagin Date: Sun Apr 10 07:11:30 UTC 2016 New revision: 297781 URL: https://svnweb.freebsd.org/changeset/base/297781 Log: More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. PR: 207386 Reviewed by: no objection form des@ MFC after: 3 weeks Changes: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_misc.h A commit references this bug: Author: dchagin Date: Sat May 7 19:05:39 UTC 2016 New revision: 299221 URL: https://svnweb.freebsd.org/changeset/base/299221 Log: MFC r295856 (by des@): Implement /proc/$$/limits. MFC r297781 (by dchagin@): More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. MFC r298318, 298319 (by cem@): Don't print uninitialized values and initialize error return before use. PR: 207386 Changes: _U stable/10/ stable/10/sys/compat/linprocfs/linprocfs.c stable/10/sys/compat/linux/linux_misc.h |
Created attachment 167233 [details] The diff of the linprocfs file. There are "(very) minor style issues" in this patch but was told they can be fixed by the committer.