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

No longer builds Arch - Kernel 6.11 proc_handler issues. #235

Open
jayray-git opened this issue Oct 3, 2024 · 8 comments
Open

No longer builds Arch - Kernel 6.11 proc_handler issues. #235

jayray-git opened this issue Oct 3, 2024 · 8 comments

Comments

@jayray-git
Copy link

jayray-git commented Oct 3, 2024

Stopped building - did a clean git and tried again after system update.
Linux 6.11.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 30 Sep 2024 23:49:50 +0000 x86_64 GNU/Linux
gcc version 14.2.1 20240910 (GCC)
GNU Make 4.4.1
./gen_compat_def > compat_def.h- Test function xt_family linux/netfilter_ipv4/ip_tables.h declared Test struct timeval linux/ktime.h undeclared egrep: warning: egrep is obsolescent; using grep -E Test struct proc_ops linux/proc_fs.h declared Test function synchronize_sched linux/rcupdate.h undeclared egrep: warning: egrep is obsolescent; using grep -E Test function nf_bridge_info_get linux/netfilter_bridge.h declared Test struct vlan_dev_priv linux/if_vlan.h declared Test function put_unaligned_be24 asm/unaligned.h declared Test function totalram_pages linux/mm.h declared Test symbol totalram_pages linux/mm.h declared Test member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h declared Test function register_sysctl_paths linux/sysctl.h undeclared egrep: warning: egrep is obsolescent; using grep -E mv compat_def.h- compat_def.h Compiling 2.6 for kernel 6.11.1-arch1-1 make -C /lib/modules/6.11.1-arch1-1/build M=/root/ipt-netflow.git modules make[1]: Entering directory '/usr/lib/modules/6.11.1-arch1-1/build' CC [M] /root/ipt-netflow.git/ipt_NETFLOW.o In file included from /root/ipt-netflow.git/ipt_NETFLOW.c:77: /root/ipt-netflow.git/compat.h:219:15: warning: no previous prototype for 'timeval_to_jiffies' [-Wmissing-prototypes] 219 | unsigned long timeval_to_jiffies(const struct timeval *tv) | ^~~~~~~~~~~~~~~~~~ /root/ipt-netflow.git/compat.h:384:20: warning: no previous prototype for 'compat_hex_to_bin' [-Wmissing-prototypes] 384 | #define hex_to_bin compat_hex_to_bin | ^~~~~~~~~~~~~~~~~ /root/ipt-netflow.git/compat.h:386:5: note: in expansion of macro 'hex_to_bin' 386 | int hex_to_bin(char ch) | ^~~~~~~~~~ /root/ipt-netflow.git/compat.h:716:20: warning: no previous prototype for 'strtoul' [-Wmissing-prototypes] 716 | unsigned long long strtoul(const char *cp, char **endp, unsigned int base) | ^~~~~~~ /root/ipt-netflow.git/ipt_NETFLOW.c:1807:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types] 1807 | .proc_handler = &hsize_procctl, | ^ /root/ipt-netflow.git/ipt_NETFLOW.c:1807:35: note: (near initialization for 'netflow_sysctl_table[3].proc_handler') /root/ipt-netflow.git/ipt_NETFLOW.c:1813:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types] 1813 | .proc_handler = &sndbuf_procctl, | ^ /root/ipt-netflow.git/ipt_NETFLOW.c:1813:35: note: (near initialization for 'netflow_sysctl_table[4].proc_handler') /root/ipt-netflow.git/ipt_NETFLOW.c:1820:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types] 1820 | .proc_handler = &destination_procctl, | ^ /root/ipt-netflow.git/ipt_NETFLOW.c:1820:35: note: (near initialization for 'netflow_sysctl_table[5].proc_handler') /root/ipt-netflow.git/ipt_NETFLOW.c:1842:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types] 1842 | .proc_handler = &flush_procctl, | ^ /root/ipt-netflow.git/ipt_NETFLOW.c:1842:35: note: (near initialization for 'netflow_sysctl_table[7].proc_handler') /root/ipt-netflow.git/ipt_NETFLOW.c:1848:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types] 1848 | .proc_handler = &protocol_procctl, | ^ /root/ipt-netflow.git/ipt_NETFLOW.c:1848:35: note: (near initialization for 'netflow_sysctl_table[8].proc_handler') make[3]: *** [scripts/Makefile.build:244: /root/ipt-netflow.git/ipt_NETFLOW.o] Error 1 make[2]: *** [/usr/lib/modules/6.11.1-arch1-1/build/Makefile:1926: /root/ipt-netflow.git] Error 2 make[1]: *** [Makefile:224: __sub-make] Error 2 make[1]: Leaving directory '/usr/lib/modules/6.11.1-arch1-1/build' make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2

@jayray-git
Copy link
Author

Specifically looking at :
/root/ipt-netflow/ipt_NETFLOW.c:1807:35: error: initialization of 'int (*)(const struct ctl_table *, int, void *, size_t *, loff_t )' {aka 'int ()(const struct ctl_table *, int, void *, long unsigned int *, long long int )'} from incompatible pointer type 'int ()(struct ctl_table *, int, void *, size_t *, loff_t )' {aka 'int ()(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} [-Wincompatible-pointer-types]
1807 | .proc_handler = &hsize_procctl,
|

@jayray-git
Copy link
Author

Kernel upgrade from (6.10.10.arch1-1 -> 6.11.2.arch1-1) is responsible after doing some digging.

@jayray-git jayray-git changed the title No longer builds Arch - Wincompatible-pointer-types No longer builds Arch - Kernel 6.11 proc_handler issues. Oct 8, 2024
@jayray-git
Copy link
Author

https://gist.github.com/jayray-git/fc468e97e57f8be3fa2d1309899198ee
made it this far with the above - new kernel signal mismatches I would guess, but I have no more ideas at this point

@axe-kenig
Copy link

I tried to make module with kernel 6.11.5 + netevents.
You missed other ctl_table lines, it should be changed too.
for kernels 6.11.3+ with changes in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6ad6e167f7fb0babc6cac6850c13d2edb5b725c2
everything will look like this:

1522
- static int hsize_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int hsize_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1539
- static int sndbuf_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int sndbuf_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1574
- static int destination_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int destination_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1591
- static int aggregation_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int aggregation_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1606
- static int promisc_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int promisc_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1623
- static int sampler_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int sampler_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1656
- static int snmp_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int snmp_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1681
- static int flush_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int flush_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1710
- static int protocol_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int protocol_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

1743
- static int natevents_procctl(ctl_table *ctl, int write, BEFORE2632(struct file *filp,)
+ static int natevents_procctl(const ctl_table *ctl, int write, BEFORE2632(struct file *filp,)

4090
- strlcpy(info.driver, dev->dev.parent->driver->name, sizeof(info.driver));
+ strscpy(info.driver, dev->dev.parent->driver->name, sizeof(info.driver));

5674
- netflow_sysctl_header = register_sysctl("net/netflow", netflow_sysctl_table);
+ netflow_sysctl_header = register_sysctl_sz("net/netflow", netflow_sysctl_table, 0);

5687
- strlcpy(destination_buf, destination, sizeof(destination_buf));
+ strscpy(destination_buf, destination, sizeof(destination_buf));

5697
- strlcpy(aggregation_buf, aggregation, sizeof(aggregation_buf));
+ strscpy(aggregation_buf, aggregation, sizeof(aggregation_buf));

5707
- strlcpy(sampler_buf, sampler, sizeof(sampler_buf));
+ strscpy(sampler_buf, sampler, sizeof(sampler_buf));

5724
- strlcpy(snmp_rules_buf, snmp_rules, sizeof(snmp_rules_buf));
+ strscpy(snmp_rules_buf, snmp_rules, sizeof(snmp_rules_buf));

@jayray-git
Copy link
Author

jayray-git commented Oct 24, 2024

I think this patch takes care of it. @axe-kenig thanks for sorting that, way beyond my level to fix.

https://gist.github.com/jayray-git/ec8a02983db622310f01f8f725019878

@k0ste
Copy link

k0ste commented Oct 30, 2024

@jayray-git please make PR, so we can include your patch in AUR

@jayray-git
Copy link
Author

jayray-git commented Oct 30, 2024

@jayray-git please make PR, so we can include your patch in AUR

@k0ste Orphaned package since 2021, and has been broke since. I took care of the upstream, someone else can do the PR. (I don't have time to deal with the new arch gitlab) *Upstream patch working.

@k0ste
Copy link

k0ste commented Oct 30, 2024

Orphaned package since 2021, and has been broke since.

Package is not orphaned, I keep it updated for almost 10 years. Patches will added as fast, as it merged to master or avail as PR

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

No branches or pull requests

3 participants