* [PATCH 1/2] xt_ACCOUNT: update prototype of `struct nf_sockopt_ops` `.set` call-back.
@ 2020-08-31 12:59 Jeremy Sowden
2020-08-31 12:59 ` [PATCH 2/2] build: bump supported kernel version to 5.9 Jeremy Sowden
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Sowden @ 2020-08-31 12:59 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Devel
In 5.9, the `void __user` parameter has been replaced by a `sockptr`.
Update `ipt_acc_set_ctl` appropriately.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
extensions/ACCOUNT/xt_ACCOUNT.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/extensions/ACCOUNT/xt_ACCOUNT.c b/extensions/ACCOUNT/xt_ACCOUNT.c
index 019f5bda007e..18e0b8a0a1b7 100644
--- a/extensions/ACCOUNT/xt_ACCOUNT.c
+++ b/extensions/ACCOUNT/xt_ACCOUNT.c
@@ -28,6 +28,9 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
+#include <linux/sockptr.h>
+#endif
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <net/netns/generic.h>
@@ -879,7 +882,12 @@ static int ipt_acc_handle_get_data(struct ipt_acc_net *ian,
}
static int ipt_acc_set_ctl(struct sock *sk, int cmd,
- void *user, unsigned int len)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
+ void *user,
+#else
+ sockptr_t arg,
+#endif
+ unsigned int len)
{
struct net *net = sock_net(sk);
struct ipt_acc_net *ian = net_generic(net, ipt_acc_net_id);
@@ -898,7 +906,12 @@ static int ipt_acc_set_ctl(struct sock *sk, int cmd,
break;
}
- if (copy_from_user(&handle, user, len)) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
+ if (copy_from_user(&handle, user, len))
+#else
+ if (copy_from_sockptr(&handle, arg, len))
+#endif
+ {
printk("ACCOUNT: ipt_acc_set_ctl: copy_from_user failed for "
"IPT_SO_SET_HANDLE_FREE\n");
break;
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] build: bump supported kernel version to 5.9.
2020-08-31 12:59 [PATCH 1/2] xt_ACCOUNT: update prototype of `struct nf_sockopt_ops` `.set` call-back Jeremy Sowden
@ 2020-08-31 12:59 ` Jeremy Sowden
2020-08-31 13:09 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Sowden @ 2020-08-31 12:59 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Devel
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 7d779964f77d..3e4755db3542 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,7 @@ if test -n "$kbuilddir"; then
echo "WARNING: Version detection did not succeed. Continue at own luck.";
else
echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
- if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 8; then
+ if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 9; then
echo "WARNING: That kernel version is not officially supported yet. Continue at own luck.";
elif test "$kmajor" -eq 5 -a "$kminor" -ge 0; then
:
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] build: bump supported kernel version to 5.9.
2020-08-31 12:59 ` [PATCH 2/2] build: bump supported kernel version to 5.9 Jeremy Sowden
@ 2020-08-31 13:09 ` Jan Engelhardt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2020-08-31 13:09 UTC (permalink / raw)
To: Jeremy Sowden; +Cc: Netfilter Devel
On Monday 2020-08-31 14:59, Jeremy Sowden wrote:
>diff --git a/configure.ac b/configure.ac
>index 7d779964f77d..3e4755db3542 100644
>--- a/configure.ac
>+++ b/configure.ac
>@@ -57,7 +57,7 @@ if test -n "$kbuilddir"; then
> echo "WARNING: Version detection did not succeed. Continue at own luck.";
> else
> echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
>- if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 8; then
>+ if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 9; then
Both processed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-31 13:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 12:59 [PATCH 1/2] xt_ACCOUNT: update prototype of `struct nf_sockopt_ops` `.set` call-back Jeremy Sowden
2020-08-31 12:59 ` [PATCH 2/2] build: bump supported kernel version to 5.9 Jeremy Sowden
2020-08-31 13:09 ` Jan Engelhardt
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 NNTP newsgroup(s).