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

CoredumpFilter= #15332

Merged
merged 4 commits into from Apr 9, 2020
Merged

CoredumpFilter= #15332

merged 4 commits into from Apr 9, 2020

Conversation

keszybz
Copy link
Member

@keszybz keszybz commented Apr 4, 2020

No description provided.

src/shared/coredump-util.h Outdated Show resolved Hide resolved
if (v >= 0) {
m |= 1 << v;
continue;
}
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't there be a syntax with "~" to remove some bits from the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

There could, but frankly, I'd prefer not to implement this just in case somebody might want it some day. I think this whole filter is a very fringe thing, and it's trivial to simply list the mask you want in full.

#define COREDUMP_FILTER_MASK_DEFAULT (1u << COREDUMP_FILTER_PRIVATE_ANONYMOUS | \
1u << COREDUMP_FILTER_SHARED_ANONYMOUS | \
1u << COREDUMP_FILTER_ELF_HEADERS | \
1u << COREDUMP_FILTER_PRIVATE_HUGE)
Copy link
Member

Choose a reason for hiding this comment

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

i'd probably define COREDUMP_FILTER_TO_MASK() which does the shifting. Just to make this more readable

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just a shift... I think the mask would make this painfully verbose and not really clearer. (And there's two places where this would be used, so I don't think it's worth it.)

src/shared/coredump-util.c Outdated Show resolved Hide resolved
src/shared/coredump-util.c Outdated Show resolved Hide resolved
man/systemd.exec.xml Show resolved Hide resolved
src/shared/coredump-util.h Outdated Show resolved Hide resolved
src/core/dbus-execute.c Outdated Show resolved Hide resolved
src/core/dbus-execute.c Outdated Show resolved Hide resolved
src/core/load-fragment.c Outdated Show resolved Hide resolved
@poettering poettering added new-feature reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Apr 7, 2020
@keszybz
Copy link
Member Author

keszybz commented Apr 9, 2020

Updated with the requested changes, except where commented above. I also added on more tiny commit to add debug logging when oom_score_adj cannot be parsed.

@keszybz keszybz removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Apr 9, 2020
Copy link
Member

@poettering poettering left a comment

Choose a reason for hiding this comment

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

one minor suggestion, looks good otherwise

src/core/execute.c Outdated Show resolved Hide resolved
man/systemd.exec.xml Show resolved Hide resolved
@poettering poettering added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Apr 9, 2020
@poettering poettering merged commit f58921b into systemd:master Apr 9, 2020
@keszybz keszybz deleted the coredump-filter branch April 10, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coredump good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed new-feature pid1
Development

Successfully merging this pull request may close these issues.

None yet

2 participants