Skip to content

Commit

Permalink
Fix a crash under Windows when fetching process information (elastic#…
Browse files Browse the repository at this point in the history
…12833) (elastic#12837)

This updates gosigar to v0.10.4 and go-sysinfo to v1.0.2.

Both releases fix a similar bug under Windows when fetching the command-line of a running process:
The offending code expected the command-line strings read from a target process to contain a null character as a terminator. However, this is not always true, and sometimes a terminator needs to be added. Most of the time the missing terminator wasn't an issue due to the runtime allocating extra space for the string, but in some extreme cases it caused a crash.

This bug manifested in:

Metricbeat's system/process metricset.
It is also used by:

Auditbeat's system/process.
Packetbeat's process monitor (disabled by default).
The add_process_metadata processor.
Beats monitoring.
libbeat/cmd/instance/beat.go

Fixes elastic#12826

(cherry picked from commit 3374b3a)
  • Loading branch information
adriansr authored Jul 9, 2019
1 parent e2de952 commit ae5f100
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 51 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ https://github.com/elastic/beats/compare/v7.2.0...7.2[Check the HEAD diff]
*Affecting all Beats*

- Fix Central Management enroll under Windows {issue}12797[12797] {pull}12799[12799]
- Fixed a crash under Windows when fetching processes information. {pull}12833[12833]

*Auditbeat*

Expand Down
7 changes: 4 additions & 3 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,8 @@ Apache License 2.0

--------------------------------------------------------------------
Dependency: github.com/elastic/go-sysinfo
Revision: 9a4be54a53be4c48b44d351d52fb425a5e274be5
Version: v1.0.2
Revision: 06c1f463545498d8f4b378d4dcf3171794c28537
License type (autodetected): Apache-2.0
./vendor/github.com/elastic/go-sysinfo/LICENSE.txt:
--------------------------------------------------------------------
Expand Down Expand Up @@ -765,8 +766,8 @@ Elasticsearch, B.V. (https://www.elastic.co/).

--------------------------------------------------------------------
Dependency: github.com/elastic/gosigar
Version: v0.10.2
Revision: 1227b9d6877d126ad640087e44439d70dba2df4f
Version: v0.10.4
Revision: f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d
License type (autodetected): Apache-2.0
./vendor/github.com/elastic/gosigar/LICENSE:
--------------------------------------------------------------------
Expand Down
9 changes: 7 additions & 2 deletions vendor/github.com/elastic/go-sysinfo/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vendor/github.com/elastic/gosigar/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions vendor/github.com/elastic/gosigar/sys/windows/syscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 52 additions & 38 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1030,46 +1030,60 @@
"versionExact": "v0.0.5"
},
{
"checksumSHA1": "pdGPPNf1TeT3fTl8Uwl55hE9/G8=",
"checksumSHA1": "u5pjOSlI10k6Q9LaRcF7OgBa2tU=",
"path": "github.com/elastic/go-sysinfo",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "GiZCjX17K265TtamGZZw4R2Jwbk=",
"path": "github.com/elastic/go-sysinfo/internal/registry",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "dVSTUnZHCLNd0tYIENqdj05RyI8=",
"path": "github.com/elastic/go-sysinfo/providers/darwin",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "LWMXshdY44+JM7g09dA4tXMZ1rY=",
"path": "github.com/elastic/go-sysinfo/providers/linux",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "RWLvcP1w9ynKbuCqiW6prwd+EDU=",
"path": "github.com/elastic/go-sysinfo/providers/shared",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "13qV0fFj6P5m1/n1HsdByRW0Hk4=",
"checksumSHA1": "E+yrwS/aZemnWUvwTvEhiczYuD8=",
"path": "github.com/elastic/go-sysinfo/providers/windows",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "OHierbaoOHx79d73DuLrao43rIg=",
"path": "github.com/elastic/go-sysinfo/types",
"revision": "9a4be54a53be4c48b44d351d52fb425a5e274be5",
"revisionTime": "2019-05-08T09:33:45Z"
"revision": "06c1f463545498d8f4b378d4dcf3171794c28537",
"revisionTime": "2019-07-09T16:49:53Z",
"version": "v1.0.2",
"versionExact": "v1.0.2"
},
{
"checksumSHA1": "bNf3GDGhZh86bfCIMM5c5AYfo3g=",
Expand Down Expand Up @@ -1246,44 +1260,44 @@
"revisionTime": "2018-08-31T13:10:45Z"
},
{
"checksumSHA1": "c1rU7WNZ+1AwZcRPBWhPBHcbZjg=",
"checksumSHA1": "0Wy9N78P/Gh12DUbixilznW67ak=",
"path": "github.com/elastic/gosigar",
"revision": "1227b9d6877d126ad640087e44439d70dba2df4f",
"revisionTime": "2019-05-08T13:07:01Z",
"version": "v0.10.2",
"versionExact": "v0.10.2"
"revision": "f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d",
"revisionTime": "2019-07-09T16:38:49Z",
"version": "v0.10.4",
"versionExact": "v0.10.4"
},
{
"checksumSHA1": "TX9y4oPL5YmT4Gb/OU4GIPTdQB4=",
"path": "github.com/elastic/gosigar/cgroup",
"revision": "1227b9d6877d126ad640087e44439d70dba2df4f",
"revisionTime": "2019-05-08T13:07:01Z",
"version": "v0.10.2",
"versionExact": "v0.10.2"
"revision": "f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d",
"revisionTime": "2019-07-09T16:38:49Z",
"version": "v0.10.4",
"versionExact": "v0.10.4"
},
{
"checksumSHA1": "hPqGM3DENaGfipEODoyZ4mKogTQ=",
"path": "github.com/elastic/gosigar/sys",
"revision": "1227b9d6877d126ad640087e44439d70dba2df4f",
"revisionTime": "2019-05-08T13:07:01Z",
"version": "v0.10.2",
"versionExact": "v0.10.2"
"revision": "f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d",
"revisionTime": "2019-07-09T16:38:49Z",
"version": "v0.10.4",
"versionExact": "v0.10.4"
},
{
"checksumSHA1": "mLq5lOyD0ZU39ysXuf1ETOLJ+f0=",
"path": "github.com/elastic/gosigar/sys/linux",
"revision": "1227b9d6877d126ad640087e44439d70dba2df4f",
"revisionTime": "2019-05-08T13:07:01Z",
"version": "v0.10.2",
"versionExact": "v0.10.2"
"revision": "f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d",
"revisionTime": "2019-07-09T16:38:49Z",
"version": "v0.10.4",
"versionExact": "v0.10.4"
},
{
"checksumSHA1": "R70u1XUHH/t1pquvHEFDeUFtkFk=",
"checksumSHA1": "ZoHlhk6iiV8eMn0ozjy6mvC5+Dc=",
"path": "github.com/elastic/gosigar/sys/windows",
"revision": "1227b9d6877d126ad640087e44439d70dba2df4f",
"revisionTime": "2019-05-08T13:07:01Z",
"version": "v0.10.2",
"versionExact": "v0.10.2"
"revision": "f75810decf6f4d88b130bfc4d2ba7ccdcea0c01d",
"revisionTime": "2019-07-09T16:38:49Z",
"version": "v0.10.4",
"versionExact": "v0.10.4"
},
{
"checksumSHA1": "Klc34HULvwvY4cGA/D8HmqtXLqw=",
Expand Down

0 comments on commit ae5f100

Please sign in to comment.