Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update SDK and build log4j2 hotpatch #1869

Merged
merged 4 commits into from
Dec 17, 2021

Conversation

bcressey
Copy link
Contributor

@bcressey bcressey commented Dec 16, 2021

Issue number:
N/A

Description of changes:
Update SDK to the new release, which includes maven, and use it to build the log4j2 hotpatch.

Testing done:
Built some variants on both architectures, for both architectures.

Additional tests:

  • smoke tested a task for aws-ecs-1
  • sonobuoy passed for aws-k8s-1.21
  • @cbgbt verified that the hotpatch jar works

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Signed-off-by: Ben Cressey <[email protected]>
Fedora 35 no longer carries the patch to rpm's `find-debuginfo.sh`
that explicitly decompresses DWARF, and consequently fails to extract
any debuginfo.

Work around this by disabling debuginfo compression at link time.

Signed-off-by: Ben Cressey <[email protected]>
Fedora 35 runs the rpath check by default, so now we can undefine the
macro to prevent it from running.

Signed-off-by: Ben Cressey <[email protected]>
@cbgbt
Copy link
Contributor

cbgbt commented Dec 16, 2021

LGTM, pending testing.

@jpculp
Copy link
Member

jpculp commented Dec 16, 2021

Looks good!

Summary: Tool for hot patching log4j2 vulnerabilities
License: Apache-2.0
URL: https://github.com/corretto/%{project}
Source0: https://github.com/corretto/%{project}/archive/%{version}/%{version}.tar.gz#/%{project}-%{version}.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: left over comment at the end? Or is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intentional; it's a URL fragment that rpm will parse as the file name for use in the %setup macro.

}
} else if (args.length == 1 && ("-h".equals(args[0]) || "-help".equals(args[0]) || "--help".equals(args[0]))) {
- System.out.println("usage: Log4jHotPatch [<pid> [<pid> ..]]");
+ System.err.println("usage: Log4jHotPatch [<pid> [<pid> ..]]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it common for -help output to be on stderr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not. Not sure if there's a good reason for this - @stewartsmith ?

Copy link
Contributor

@samuelkarp samuelkarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(hit the wrong button, approving)

@bcressey bcressey marked this pull request as ready for review December 17, 2021 01:49
@bcressey bcressey merged commit e23fd80 into bottlerocket-os:develop Dec 17, 2021
@bcressey bcressey deleted the log4j2-hotpatch branch December 17, 2021 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants