|
Bugzilla – Full Text Bug Listing |
| Summary: | IRIX 6.5.22 - sudo fails to compile due to MAP_ANON being undefined | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Kazuo Kuroi <kazuok> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | daniel.hams, max.z.gewalt |
| Priority: | low | ||
| Version: | 1.8.30 | ||
| Hardware: | SGI | ||
| OS: | IRIX | ||
| Attachments: |
IRIX-specific patch for sudo
MAP_ANON test success MAP_SGI_ANYADDR test fail |
||
|
Description
Kazuo Kuroi
2020-01-27 15:49:22 MST
Thanks, I committed a slightly different patch that just checks for MAP_SGI_ANYADDR instead of using __sgi. https://www.sudo.ws/repos/sudo/rev/9dce3ebb2c37 Cool, thank you for your prompt attention Todd. If there's any further IRIX-specific issues that I find or else someone else does, I'll be happy to maintain the SGI compatibility. :) Created attachment 541 [details]
MAP_ANON test success
MAP_ANON example success
Created attachment 542 [details]
MAP_SGI_ANYADDR test fail
Example mmap MAP_SGI_ANYADDR fail
This is wrong, linked documentation in original post even shows it. MAP_SGI_ANYADDR = Enable mmap to "locked out regions" of memory MAP_ANON = Create zero filled memory allocation Completely different... MAP_SGI_ANYADDR with fd of -1 also even fails in IRIX! Maybe no sudo test case coverage? Fail MAP_SGI_ANYADDR case, success MAP_ANON case attached. Where does MAP_SGI_ANYADDR idea even come from? Hi Max, I know it's not "Correct" as it doesn't create an anonymous mapping. I mentioned that in my initial post. If you have a better way of correcting the issue, by all means be my guest. The IRIX mman.h has MAP_SGI_ANYADDR set to flag 0x1000, same as MAP_ANONYMOUS on NetBSD: % uname -rsm NetBSD 9.99.13 evbarm % grep MAP_ANONYMOUS /usr/include/sys/mman.h #define MAP_ANONYMOUS 0x1000 /* allocated from memory, swap space */ % grep 0x1000 /usr/include/sys/mman.h #define MAP_SGI_ANYADDR 0x1000 So pardon my transgression in trying to help. I'm not a particularly smart developer, just one whose enough of an idiot to try something. Hello, Would like to nip this in the bud before it becomes part of the sudo tree. This change (a) Doesnt work (you can't just use MAP_SGI_ANYADDR because it matches something on FreeBSD) (b) Can't have been tested We've had confirmation of working approach and behaviour (and passing tests) here (patched against 1.8.29). https://github.com/sgidevnet/sgug-rse/commit/e25f822f4cbbc677635c85279808ceac9a00b3e2 And as a side note - GCC _does_ indeed define "__sgi" on Irix too. Probably important to mention too - the code I linked to isn't correct either (it's missing a mmap call) - but I'm not advocating for merging that. I think it's an unfair burden on project maintainers to look after a long gone OS. What I _am_ advocating is that the proposed change using MAP_SGI_ANYADDR isn't merged. I've committed changes to avoid MAP_ANON where is it not supported. There was already some code to handle this in other parts of the sudo code base. The changes will be in the next sudo 1.8.x release. Much respect to both Max and Daniel here for chiming in on this. I simply was trying to fix __something__ because not having an up to date sudo is kind of a bummer. The fact that this is being fixed one way or the other is a good thing. With regards to gcc on IRIX using __sgi, that's good to know. I mostly focus on native compiling for my own ventures, so i have little experience using GNU cc. Thanks to everyone involved. Thanks Todd, that seems a most reasonable compromise. @Kazuo - if it's of interest - the set of patches we use with gcc (and should work with Mipspro too) - can be found here: https://github.com/sgidevnet/sgug-rse/tree/master/packages/sudo/SOURCES They are against 1.8.29 but possibly can be pulled forward for your version of interest too. Current status is good for me -> OK to close. Thanks for your time. Never saw this close, since I opened it, I'm marking it fixed. Tyvm Todd, Max and Daniel |