smatch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Laurent Philippart (Nokia)" <laurent.philippart@nokia.com>
To: "smatch@vger.kernel.org" <smatch@vger.kernel.org>
Subject: Smatch or Coccinelle for BPF static code analysis
Date: Sun, 15 Jan 2023 18:08:19 +0000	[thread overview]
Message-ID: <AS1PR07MB86169AAD88386D2DCB40BAEA9FC09@AS1PR07MB8616.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <AS1PR07MB861601C6DE40BBE6E8D6ACCD9FC09@AS1PR07MB8616.eurprd07.prod.outlook.com>

Hi,

I'm looking for guidance on what would be the easiest/best choice for implementing malware detection rules on BPF source code (also looking at what can be done on ELF and bytecode but that's a separate question).

The majority of these rules will be looking at combinations of:
- Hook points used
- File names/paths
- Kernel structs like linux_dirent64
- Helper function calls like bpf_probe_write_user(), bpf_send_signal()

Both smatch and coccinelle seem to require a bit of learning curve (although the latter seem to have a more documentation/examples than the former) so your opinion would be highly appreciated.

This is for a personal research project, nothing related to the company I am working for.

Best regards
Laurent Philippart

       reply	other threads:[~2023-01-15 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AS1PR07MB861601C6DE40BBE6E8D6ACCD9FC09@AS1PR07MB8616.eurprd07.prod.outlook.com>
2023-01-15 18:08 ` Laurent Philippart (Nokia) [this message]
2023-01-18 15:46   ` Smatch or Coccinelle for BPF static code analysis Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS1PR07MB86169AAD88386D2DCB40BAEA9FC09@AS1PR07MB8616.eurprd07.prod.outlook.com \
    --to=laurent.philippart@nokia.com \
    --cc=smatch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).