Rework the special SGI CPU numbering logic in the Linux PMDA.
This resolves a buffer overflow bug in the use of realpath(3)
in this routine, which was being passed a too-small buffer.
This issue was initially reported to us by Chandana De Silva,
but looks like others have come across it too, e.g.: https://bugs.launchpad.net/ubuntu/+source/pcp/+bug/384776
I've removed the unused "cname" field from the per-CPU data
structure, and also added some short-circuit logic into this
code so that we bail out of this logic early if no hardware-
graph filesystem paths are detected (which will be the normal
case for most people).
Rework the special SGI CPU numbering logic in the Linux PMDA.
This resolves a buffer overflow bug in the use of realpath(3)
in this routine, which was being passed a too-small buffer.
This issue was initially reported to us by Chandana De Silva,
but looks like others have come across it too, e.g.:
https://bugs.launchpad.net/ubuntu/+source/pcp/+bug/384776
I've removed the unused "cname" field from the per-CPU data
structure, and also added some short-circuit logic into this
code so that we bail out of this logic early if no hardware-
graph filesystem paths are detected (which will be the normal
case for most people).