** Tags added: kernel-daily-bug

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2069807

Title:
  BPF Filtering issues with 20.04.5/5.4.0-126

Status in Ubuntu:
  Invalid
Status in linux package in Ubuntu:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2069807/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to