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)

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
  • Loading branch information
adriansr committed Jul 9, 2019
1 parent 4eb411b commit 2b6763d
Show file tree
Hide file tree
Showing 7 changed files with 120 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 @@ -14,6 +14,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Update to Golang 1.12.4. {pull}11782[11782]
- Update to ECS 1.0.1. {pull}12284[12284] {pull}12317[12317]
- Default of output.kafka.metadata.full is set to false by now. This reduced the amount of metadata to be queried from a kafka cluster. {pull}12738[12738]
- 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 @@ -786,7 +786,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 @@ -836,8 +837,8 @@ Elasticsearch, B.V. (https://www.elastic.co/).

--------------------------------------------------------------------
Dependency: github.com/elastic/gosigar
Version: v0.10.3
Revision: 99ed9cf55303a9d3936cb656b9a86a4a6e67b30a
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.

6 changes: 6 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 @@ -1143,46 +1143,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 @@ -1359,44 +1373,44 @@
"revisionTime": "2018-08-31T13:10:45Z"
},
{
"checksumSHA1": "tuhGcluN3UtoiFBovqsep6aPx3s=",
"checksumSHA1": "0Wy9N78P/Gh12DUbixilznW67ak=",
"path": "github.com/elastic/gosigar",
"revision": "99ed9cf55303a9d3936cb656b9a86a4a6e67b30a",
"revisionTime": "2019-05-27T11:32:19Z",
"version": "v0.10.3",
"versionExact": "v0.10.3"
"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": "99ed9cf55303a9d3936cb656b9a86a4a6e67b30a",
"revisionTime": "2019-05-27T11:32:19Z",
"version": "v0.10.3",
"versionExact": "v0.10.3"
"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": "99ed9cf55303a9d3936cb656b9a86a4a6e67b30a",
"revisionTime": "2019-05-27T11:32:19Z",
"version": "v0.10.3",
"versionExact": "v0.10.3"
"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": "99ed9cf55303a9d3936cb656b9a86a4a6e67b30a",
"revisionTime": "2019-05-27T11:32:19Z",
"version": "v0.10.3",
"versionExact": "v0.10.3"
"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": "99ed9cf55303a9d3936cb656b9a86a4a6e67b30a",
"revisionTime": "2019-05-27T11:32:19Z",
"version": "v0.10.3",
"versionExact": "v0.10.3"
"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 2b6763d

Please sign in to comment.