Skip to contentSkip to conversation

Fixes for 2.6.29

PATCH New Paul Moore 1 participant 3 messages Feb 20, 2009

Subsystems (3)
lore
Share & tools
lore

Paul Moore

author
#0 lore raw

cover Fixes for 2.6.29

Two small patches I'd like to propose for 2.6.29 as they are low-risk bug fixes. Please review and merge if acceptable - thanks.

The following changes since commit 402a917aca5daca69fcc91f43e6f1e6939cf393b:
Linus Torvalds (1):
Merge master.kernel.org:/home/rmk/linux-2.6-arm

are available in the git repository at:

git://git.infradead.org/users/pcmoore/lblnet-2.6 master

Paul Moore (2):
cipso: Fix documentation comment
selinux: Fix the NetLabel glue code for setsockopt()

---

Paul Moore (2):
selinux: Fix the NetLabel glue code for setsockopt()
cipso: Fix documentation comment

 net/ipv4/cipso_ipv4.c       |    9 +++++++--
 security/selinux/netlabel.c |    4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

author
#1 lore raw

PATCH 1/2 cipso: Fix documentation comment

The CIPSO protocol engine incorrectly stated that the FIPS-188 specification could be found in the kernel's Documentation directory. This patch corrects that by removing the comment and directing users to the FIPS-188 documented hosted online. For the sake of completeness I've also included a link to the CIPSO draft specification on the NetLabel website.

Thanks to Randy Dunlap for spotting the error and letting me know.

---

 net/ipv4/cipso_ipv4.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
net/ipv4/cipso_ipv4.c +7 -2
index 6bb2635..7bc9929 100644
@@ -3,11 +3,16 @@
  *
  * This is an implementation of the CIPSO 2.2 protocol as specified in
  * draft-ietf-cipso-ipsecurity-01.txt with additional tag types as found in
- * FIPS-188, copies of both documents can be found in the Documentation
- * directory.  While CIPSO never became a full IETF RFC standard many vendors
+ * FIPS-188.  While CIPSO never became a full IETF RFC standard many vendors
  * have chosen to adopt the protocol and over the years it has become a
  * de-facto standard for labeled networking.
  *
+ * The CIPSO draft specification can be found in the kernel's Documentation
+ * directory as well as the following URL:
+ *   http://netlabel.sourceforge.net/files/draft-ietf-cipso-ipsecurity-01.txt
+ * The FIPS-188 specification can be found at the following URL:
+ *   http://www.itl.nist.gov/fipspubs/fip188.htm
+ *
  * Author: Paul Moore <[email protected]>
  *
  */

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

author
#2 lore raw

PATCH 2/2 selinux: Fix the NetLabel glue code for setsockopt()

In reply to Paul Moore

At some point we (okay, I) managed to break the ability for users to use the setsockopt() syscall to set IPv4 options when NetLabel was not active on the socket in question. The problem was noticed by someone trying to use the "-R" (record route) option of ping:

 # ping -R 10.0.0.1
 ping: record route: No message of desired type

The solution is relatively simple, we catch the unlabeled socket case and clear the error code, allowing the operation to succeed. Please note that we still deny users the ability to override IPv4 options on socket's which have NetLabel labeling active; this is done to ensure the labeling remains intact.

---

 security/selinux/netlabel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
security/selinux/netlabel.c +3 -1
index f58701a..3f4b266 100644
@@ -490,8 +490,10 @@ int selinux_netlbl_socket_setsockopt(struct socket *sock,
 		lock_sock(sk);
 		rc = netlbl_sock_getattr(sk, &secattr);
 		release_sock(sk);
-		if (rc == 0 && secattr.flags != NETLBL_SECATTR_NONE)
+		if (rc == 0)
 			rc = -EACCES;
+		else if (rc == -ENOMSG)
+			rc = 0;
 		netlbl_secattr_destroy(&secattr);
 	}
 

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.