Skip to contentSkip to conversation

two bugfixes to ownercmd

PATCH Applied Jonas Berlin 2 participants 2 messages Feb 17, 2005 – Feb 19, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 two bugfixes to ownercmd

I found two bugs in the ownercmd patch in patch-o-matic-ng. The patch adds the ipv6 version of the same functionality already found in stock kernels for ipv4.

[1] Only affects 2.6 version of the ownercmd patch.

In 2.4, read locks are used for files->file_lock
In 2.6, spinlocks are used instead.

The current 2.6 patch illegally uses read locks, which causes compiler warnings. If you look at the other functions in the same file (ip6t_owner.c), it's easy to see spinlocks are used for the same operations everywhere else in the file.

[2] Both the 2.4 and 2.6 patches lack an update to the SMP checks done in the checkentry() function. The ipv4 version in the stock kernel does this properly, so I updated the checks according to that.

The attached files contain all the previous changes plus my bugfixes for the above bugs, and should therefore be drop-in replacements for the current ones.

Signature · 1 line
- xkr47
include/linux/netfilter_ipv6/ip6t_owner.h +2 -0
diff -ur --exclude-from=/tmp/srcdiff.excludes.K336vZ -N orig-linux-2.4.28/include/linux/netfilter_ipv6/ip6t_owner.h linux-2.4.28/include/linux/netfilter_ipv6/ip6t_owner.h
@@ -6,12 +6,14 @@
 #define IP6T_OWNER_GID	0x02
 #define IP6T_OWNER_PID	0x04
 #define IP6T_OWNER_SID	0x08
+#define IP6T_OWNER_COMM 0x10
 
 struct ip6t_owner_info {
     uid_t uid;
     gid_t gid;
     pid_t pid;
     pid_t sid;
+    char comm[16];
     u_int8_t match, invert;	/* flags */
 };
 
net/ipv6/netfilter/ip6t_owner.c +41 -2

61 lines not on this page · raw message

include/linux/netfilter_ipv6/ip6t_owner.h +2 -0
diff -ur --exclude-from=/tmp/srcdiff.excludes.ye2xex -N orig-linux-2.6.10/include/linux/netfilter_ipv6/ip6t_owner.h linux-2.6.10/include/linux/netfilter_ipv6/ip6t_owner.h
@@ -6,12 +6,14 @@
 #define IP6T_OWNER_GID	0x02
 #define IP6T_OWNER_PID	0x04
 #define IP6T_OWNER_SID	0x08
+#define IP6T_OWNER_COMM 0x10
 
 struct ip6t_owner_info {
     uid_t uid;
     gid_t gid;
     pid_t pid;
     pid_t sid;
+    char comm[16];
     u_int8_t match, invert;	/* flags */
 };
 
net/ipv6/netfilter/ip6t_owner.c +42 -2

62 lines not on this page · raw message

Applied
#1 lore raw
Quoted 3 lines · Jonas Berlin

I found two bugs in the ownercmd patch in patch-o-matic-ng. The patch adds the ipv6 version of the same functionality already found in stock kernels for ipv4.

thanks, applied to svn (3729)

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie