Summary: | test-fdpass is not actually compiled or run | ||
---|---|---|---|
Product: | dbus | Reporter: | Simon McVittie <smcv> |
Component: | core | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | D-Bus Maintainers <dbus> |
Severity: | normal | ||
Priority: | medium | CC: | bugzilla |
Version: | git master | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | review? | ||
i915 platform: | i915 features: | ||
Attachments: |
Add test-fdpass to the build, and make it compile again
Reduce the number of fds the fdpass test uses Reduce the number of fds the fdpass test uses |
Description
Simon McVittie
2015-02-05 14:16:46 UTC
For context, this was a regression test for CVE-2014-3635 and related bugs; I added the test, but the Makefile.am part got lost somewhere. Comment on attachment 113198 [details] [review] Add test-fdpass to the build, and make it compile again Review of attachment 113198 [details] [review]: ----------------------------------------------------------------- ++ Fixed in git for 1.9.10 Created attachment 113326 [details] [review] Reduce the number of fds the fdpass test uses It was relying on a higher-than-default fd limit; cut it down to more than 256 but rather less than 1024, since the default Linux limit is 1024 fds per user. (In reply to Simon McVittie from comment #4) > Created attachment 113326 [details] [review] > Reduce the number of fds the fdpass test uses > > It was relying on a higher-than-default fd limit; cut it down to > more than 256 but rather less than 1024, since the default Linux > limit is 1024 fds per user. For context, this was breaking a continuous integration framework (autopkgtest) while testing Bug #61301, which altered the environment in which my gnome-terminal runs, giving it fewer fds to play with. Comment on attachment 113326 [details] [review] Reduce the number of fds the fdpass test uses Review of attachment 113326 [details] [review]: ----------------------------------------------------------------- ::: test/fdpass.c @@ +59,4 @@ > > /* Arbitrary, except that MAX_MESSAGE_UNIX_FDS * SOME_MESSAGES must be > * less than the process's file descriptor limit. */ > +#define SOME_MESSAGES 20 You could also add a spruced up version of this in main(): struct rlimit limit; assert (getrlimit (RLIMIT_NOFILE, &limit) == 0); assert (MAX_MESSAGE_UNIX_FDS * SOME_MESSAGES < limit.rlim_cur); And if you want to ensure it’s more than 256: _DBUS_STATIC_ASSERT (MAX_MESSAGE_UNIX_FDS * SOME_MESSAGES > 256); Created attachment 113347 [details] [review] Reduce the number of fds the fdpass test uses It was relying on a higher-than-default fd limit; cut it down to more than 256 but rather less than 1024, since the default Linux limit is 1024 fds per user. Also automatically skip this test if our rlimit is too small. Comment on attachment 113347 [details] [review] Reduce the number of fds the fdpass test uses Review of attachment 113347 [details] [review]: ----------------------------------------------------------------- ++ Thanks, fixed (again) in git for 1.9.12. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.