1. 04 Oct, 2017 1 commit
    • Prashant Bhole's avatar
      examples:dns_matching: make it work as DNS sniffer · af83f6ff
      Prashant Bhole authored
      Reason:
      The intention of initial version of this example was to provide
      a loop-uprolling example and expected functionality was to drop
      DNS packets requesting the DNS name contained in the map.
         But the functionality doesn't work as exepected because the
      BPF program attached to the raw socket only filters the packets
      received by the python program.
      
      With these modifications, it still serves as a loop-unrolling
      example, with slightly different functionality.
      
      Inverted return values of bpf program. It keeps the packet if the
      name in DNS packet is also exists in the map. All other packets
      are dropped.
      Python program is modified to read packets from raw socket.
      DNS data from the packet is parsed and printed using dnslib library.
      af83f6ff
  2. 02 Oct, 2017 1 commit
  3. 01 Oct, 2017 1 commit
  4. 29 Sep, 2017 1 commit
    • Paul Chaignon's avatar
      Traces external pointers in parenthesized expressions · c5ca2a67
      Paul Chaignon authored
      Partially reverts 80667b7b, "Fix unary operator handling of probe
      reads with parens", keeping the test case. With 4c6ecb46,
      "Restrict rewrite of unary operators to dereference operator," only
      dereferences are rewritten, removing the need for the previous fix.
      
      Reverting 80667b7b allows bcc to rewrite more dereferences, as
      highlighted in the new test case.
      c5ca2a67
  5. 28 Sep, 2017 3 commits
  6. 27 Sep, 2017 1 commit
  7. 26 Sep, 2017 6 commits
  8. 25 Sep, 2017 4 commits
    • Teng Qin's avatar
      Add ELF load ranges for executable binaries · 5db9d37b
      Teng Qin authored
      5db9d37b
    • Teng Qin's avatar
      Add common helper to read Process executable · 97562956
      Teng Qin authored
      97562956
    • yonghong-song's avatar
      Merge pull request #1357 from palmtenor/load_section · 899d3e92
      yonghong-song authored
      Fix edge case when doing symbol name -> address resolution
      899d3e92
    • Kirill Smelkov's avatar
      bpf_probe_read*: src argument should be const void *. · 2dc7daad
      Kirill Smelkov authored
      For the following program:
      
          #include <linux/interrupt.h>
      
          // remember t(last-interrupt) on interface
          int kprobe__handle_irq_event_percpu(struct pt_regs *ctx, struct irq_desc *desc) {
              const char *irqname = desc->action->name;
      
              char c;
      
              bpf_probe_read(&c, 1, &irqname[0]);
              if (c != 'e') return 0;
      
              bpf_probe_read(&c, 1, &irqname[1]);
              if (c != 't') return 0;
      
              ...
      
      LLVM gives warnings because irqaction->name is `const char *`:
      
          /virtual/main.c:10:27: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              bpf_probe_read(&c, 1, &irqname[0]);
                                    ^~~~~~~~~~~
          /virtual/main.c:13:27: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              bpf_probe_read(&c, 1, &irqname[1]);
                                    ^~~~~~~~~~~
          ...
      
      Instead of adding casts in source everywhere fix bpf_probe_read* signature to
      indicate the memory referenced by src won't be modified, as it should be.
      
      P.S.
      
      bpf_probe_read_str was in fact already marked so in several places in comments
      but not in actual signature.
      2dc7daad
  9. 21 Sep, 2017 6 commits
  10. 20 Sep, 2017 3 commits
  11. 15 Sep, 2017 2 commits
  12. 13 Sep, 2017 1 commit
  13. 12 Sep, 2017 2 commits
  14. 09 Sep, 2017 2 commits
  15. 08 Sep, 2017 4 commits
  16. 07 Sep, 2017 2 commits