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

Segmentation fault (core dumped) when running dnsdist client mode and dbpf:excludeRange #10090

Closed
rage4 opened this issue Feb 16, 2021 · 4 comments · Fixed by #10095
Closed
Assignees
Milestone

Comments

@rage4
Copy link
Contributor

rage4 commented Feb 16, 2021

  • Program: dnsdist
  • Issue type: Bug report

Short description

dnsdist client mode crashes with "Segmentation fault (core dumped)" when using eBPF excludeRange

Environment

  • Operating system: Ubuntu 16.04 LTS with HWE kernel
  • Software version: dnsdist 1.6.0-alpha0.326.master.gd799ea222
  • Software source: PowerDNS repository

Steps to reproduce

  1. setup dnsdist
  2. add the following lines to config, restart
bpf = newBPFFilter(1024, 1024, 1024)
setDefaultBPFFilter(bpf)
bpf:blockQName(newDNSName("."))

dbpf = newDynBPFFilter(bpf)
dbpf:excludeRange({ "88.198.139.2/32", "88.198.139.3/32" })
registerDynBPFFilter(dbpf)

function maintenance()
 addBPFFilterDynBlocks(exceedQRate(100, 1), dbpf, 120)
 dbpf:purgeExpired()
end
  1. run dnsdist -c

Expected behaviour

correct access to dnsdist client console

Actual behaviour

Segmentation fault (core dumped)

Other information

@rage4 rage4 changed the title Segmentation fault (core dumped) when running dnsdist client mode an eBPF excludeMask Segmentation fault (core dumped) when running dnsdist client mode and eBPF excludeMask Feb 16, 2021
@rage4 rage4 changed the title Segmentation fault (core dumped) when running dnsdist client mode and eBPF excludeMask Segmentation fault (core dumped) when running dnsdist client mode and dbpf:excludeRange Feb 16, 2021
@pieterlexis pieterlexis added this to the dnsdist-1.6.0 milestone Feb 16, 2021
@rage4
Copy link
Contributor Author

rage4 commented Feb 16, 2021

side note - as I'm aware the issue was there also in 1.5.x

@rgacogne rgacogne self-assigned this Feb 17, 2021
@rgacogne
Copy link
Member

Right, that's because newDynBPFFilter(bpf) returns nullptr (nil) in client mode, and then calling excludeRange on that pointer triggers a null pointer dereference..
We have seen that for other objects already, we can either return a mockup object or check for nullptr in all BPFFilter methods.

@pieterlexis
Copy link
Contributor

I'm wondering if it would make sense to have multiple configs with all options enabled and test the client mode in our CI as well

@rgacogne
Copy link
Member

I'm wondering if it would make sense to have multiple configs with all options enabled and test the client mode in our CI as well

That would be very nice to have, yes.

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

Successfully merging a pull request may close this issue.

3 participants