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

kernel/common-config: enable INET_{TCP,UDP,RAW}_DIAG and INET_DIAG_DESTROY #69388

Merged
merged 1 commit into from Sep 26, 2019

Conversation

ivan
Copy link
Member

@ivan ivan commented Sep 24, 2019

Motivation for this change

These are required for some ss functionality. ss -K is particularly useful for killing connections and requires INET_DIAG_DESTROY. As far as I know, this is the only reliable way to kill stuck connections on Linux.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @thoughtpolice

I tested on 4.19.75-hardened and confirmed that ss -K dst SOME_IP_ADDRESS dport = 80 did not work before this change, and did work after this change.

INET_TCP_DIAG = module;
INET_UDP_DIAG = module;
INET_RAW_DIAG = whenAtLeast "4.14" module;
INET_DIAG_DESTROY = whenAtLeast "4.9" yes;
Copy link
Member

Choose a reason for hiding this comment

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

Do these DIAG options incur a performance penalty we need to be aware of?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think there is a performance penalty. I looked at

https://github.com/torvalds/linux/blob/master/net/ipv4/udp_diag.c
https://github.com/torvalds/linux/blob/master/net/ipv4/tcp_diag.c
https://github.com/torvalds/linux/blob/master/net/ipv4/raw_diag.c

and it looks like they just provide additional functions. The init handler doesn't appear to change any network stack behavior.

INET_DIAG_DESTROY should be fine too; it is not referenced outside those _diag modules.

Copy link
Member

Choose a reason for hiding this comment

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

@grahamc it only extends the netlink API of the kernel. Looks fine to me.

@ivan ivan changed the title kernel/common-config: enable INET_{TCP,UDP,RAW}_DIAG and INET_DIAG_DE… kernel/common-config: enable INET_{TCP,UDP,RAW}_DIAG and INET_DIAG_DESTROY Sep 24, 2019
@ivan ivan mentioned this pull request Sep 24, 2019
2 tasks
@teto
Copy link
Member

teto commented Sep 25, 2019

what about other distribs (please link the configs so I can add them to https://nixos.wiki/wiki/Linux_kernel)

@Mic92
Copy link
Member

Mic92 commented Sep 25, 2019

what about other distribs (please link the configs so I can add them to nixos.wiki/wiki/Linux_kernel)

Both debian and archlinux also seems to include these modules.

@Mic92
Copy link
Member

Mic92 commented Sep 25, 2019

@GrahamcOfBorg eval

1 similar comment
@Mic92
Copy link
Member

Mic92 commented Sep 25, 2019

@GrahamcOfBorg eval

@Mic92
Copy link
Member

Mic92 commented Sep 25, 2019

I still wonder why the evaluation error persists.

@veprbl
Copy link
Member

veprbl commented Sep 25, 2019

@Mic92 Because the fix was not merged into staging and staging-next
@GrahamcOfBorg eval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants