public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maninder Singh <maninder1.s@samsung.com>
To: Maninder Singh <maninder1.s@samsung.com>,
	"paul@paul-moore.com" <paul@paul-moore.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Vaneet Narang <v.narang@samsung.com>,
	AJEET YADAV <ajeet.y@samsung.com>
Subject: [Fix kernel crash in cipso_v4_sock_delattr ]
Date: Mon, 30 Mar 2015 11:09:00 +0000 (GMT)	[thread overview]
Message-ID: <1603159082.92241427713739372.JavaMail.weblogic@epmlwas01c> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 2094 bytes --]


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 .)

Crash Logs :
[0-182.2400] [<c04c7fa4>] (cipso_v4_sock_delattr+0x0/0x74) from [<c0517b64>] (netlbl_sock_delattr+0x18/0x1c)
[0-182.2497]  r4:00000000 r3:c07872f8
[0-182.2531] [<c0517b4c>] (netlbl_sock_delattr+0x0/0x1c) from [<c027b2fc>] (smack_netlabel+0x88/0x9c)
[0-182.2622] [<c027b274>] (smack_netlabel+0x0/0x9c) from [<c027b43c>] (smack_netlabel_send+0x12c/0x144)
[0-182.2714]  r7 9ce9500 r6 7b67ef4 r5:c076f408 r4 8903dc0
[0-182.2770] [<c027b310>] (smack_netlabel_send+0x0/0x144) from [<c027b4a8>] (smack_socket_sendmsg+0x54/0x60)
[0-182.2866] [<c027b454>] (smack_socket_sendmsg+0x0/0x60) from [<c02789ec>] (security_socket_sendmsg+0x28/0x2c)
[0-182.2966] [<c02789c4>] (security_socket_sendmsg+0x0/0x2c) from [<c04343b0>] (sock_sendmsg+0x68/0xc0)
[0-182.3058] [<c0434348>] (sock_sendmsg+0x0/0xc0) from [<c04369e8>] (SyS_sendto+0xd8/0x110)
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by : Ajeet Yadav <ajeet.y@samsung.com>
---
 net/netlabel/netlabel_kapi.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
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;
+ }
 }
 
 /**
-- 
1.7.9.5


Thanks and Regards,
Maninder Singhÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

             reply	other threads:[~2015-03-30 11:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 11:09 Maninder Singh [this message]
2015-03-30 11:32 ` [Fix kernel crash in cipso_v4_sock_delattr ] Paul Moore
2015-03-30 17:25   ` Casey Schaufler
  -- strict thread matches above, loose matches on Subject: below --
2015-03-31  5:09 Maninder Singh
2015-03-31 17:52 ` Casey Schaufler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603159082.92241427713739372.JavaMail.weblogic@epmlwas01c \
    --to=maninder1.s@samsung.com \
    --cc=ajeet.y@samsung.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=v.narang@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox