Message ID | 1603159082.92241427713739372.JavaMail.weblogic@epmlwas01c |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
On Monday, March 30, 2015 11:09:00 AM Maninder Singh wrote: > Dear All, > we found One Kernel Crash issue in cipso_v4_sock_delattr :- > As Cipso supports only inet sockets so cipso_v4_sock_delattr will crash when > try to access any other socket type. cipso_v4_sock_delattr access > sk_inet->inet_opt which may contain not NULL but invalid address. we found > this issue with netlink socket.(reproducible by trinity using sendto system > call .) Hello, First, please go read the Documentation/SubmittingPatches from the kernel sources; your patch needs to be resubmitted and the instructions in that file will show you how to do it correctly next time. Second, this appears to only affect Smack based systems, yes? SELinux based systems should have the proper checking in place to prevent this (the checks are handled in the LSM). That said, it probably wouldn't hurt to add the extra checking to netlbl_sock_delattr(). If you properly resubmit your patch I'll ACK it. -Paul
On 3/30/2015 4:32 AM, Paul Moore wrote: > On Monday, March 30, 2015 11:09:00 AM Maninder Singh wrote: >> Dear All, >> we found One Kernel Crash issue in cipso_v4_sock_delattr :- >> As Cipso supports only inet sockets so cipso_v4_sock_delattr will crash when >> try to access any other socket type. cipso_v4_sock_delattr access >> sk_inet->inet_opt which may contain not NULL but invalid address. we found >> this issue with netlink socket.(reproducible by trinity using sendto system >> call .) > Hello, > > First, please go read the Documentation/SubmittingPatches from the kernel > sources; your patch needs to be resubmitted and the instructions in that file > will show you how to do it correctly next time. > > Second, this appears to only affect Smack based systems, yes? SELinux based > systems should have the proper checking in place to prevent this (the checks > are handled in the LSM). This looks like a problem that was fixed some time ago. The current Smack code clearly checks for this. What kernel version are you testing against? > That said, it probably wouldn't hurt to add the > extra checking to netlbl_sock_delattr(). If you properly resubmit your patch > I'll ACK it. > > -Paul > -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 7c94aed..7a2c6f5 100755 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c @@ -700,7 +700,13 @@ socket_setattr_return: */ void netlbl_sock_delattr(struct sock *sk) { - cipso_v4_sock_delattr(sk); + switch (sk->sk_family) { + case AF_INET: + cipso_v4_sock_delattr(sk); + break; + default: + break; + } } /**