BPF Filtering issues with 20.04.5/5.4.0-126

Bug #2069807 reported by Florian Scholz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned
linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

Good morning,
we are currently porting an old kernel driver to Linux kernel 5.4.0-126 on Ubuntu 20.04.5 LTS and noted odd behaviour that doesn't occur with the same kernel version on Ubuntu 20.04.6 LTS.

The installation is fresh and based on the Ubuntu Server images + OpenSSH and the generic kernel.

ii linux-headers-5.4.0-126 5.4.0-126.142 all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-126-generic 5.4.0-126.142 amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii linux-image-5.4.0-126-generic 5.4.0-126.142 amd64 Signed kernel image generic
ii linux-modules-5.4.0-126-generic 5.4.0-126.142 amd64 Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP

The driver basically opens a raw socket and configures mac address filtering based on BPF with sock_setsockopt.

 struct sock_filter lsf_code[] = {
   { 0x20, 0, 0, 0x00000008 },
   { 0x15, 0, 3, 0xcc112233 },
   { 0x28, 0, 0, 0x00000006 },
   { 0x15, 0, 1, 0x0000aabb },
   { 0x6, 0, 0, 0x0000ffff },
   { 0x6, 0, 0, 0x00000000 },
 };
 struct sock_fprog lsf = {
  .len = ARRAY_SIZE(lsf_code),
  .filter = lsf_code,
 };
 lsf_code[1].k = ntohl(*((__u32 *)&eci->cfg.dst_ieee[2]));
 lsf_code[3].k = ntohl(*((__u32 *)&eci->cfg.dst_ieee[0])) >> 16;
  if ((result = kernel_setsockopt(eci->sock, SOL_SOCKET, SO_ATTACH_FILTER, (char *)&lsf, sizeof(lsf))) < 0) {
   PRINTE("eci_open2(%d): attachment of LSF to socket failed - result %d\n",
     eci->dev, result);
   return (result);
  }
Thank you very much and Best Regards,
Florian Scholz

description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/2069807/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Paul White (paulw2u) wrote :

Invalidating redundant Ubuntu task.

Changed in ubuntu:
status: New → Invalid
tags: added: focal
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.