summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2009-01-08 18:35:47 +0000
committerAlexis Ballier <aballier@gentoo.org>2009-01-08 18:35:47 +0000
commit49fca6707b154e028f915f41eb8655276a5a27a0 (patch)
tree5e59267d2f6ec686d75067c5a391986342aa189c /sys-freebsd
parentfix up SRC_URI as mentioned by Xake in bug #250975 (diff)
downloadhistorical-49fca6707b154e028f915f41eb8655276a5a27a0.tar.gz
historical-49fca6707b154e028f915f41eb8655276a5a27a0.tar.bz2
historical-49fca6707b154e028f915f41eb8655276a5a27a0.zip
Fix module symbols export with latest binutils, grab a bunch of security fixes from security.freebsd.org.
Package-Manager: portage-2.2_rc20/cvs/Linux 2.6.28 x86_64
Diffstat (limited to 'sys-freebsd')
-rw-r--r--sys-freebsd/freebsd-sources/ChangeLog15
-rw-r--r--sys-freebsd/freebsd-sources/Manifest15
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-amd64.patch25
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-arc4random6x.patch81
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-icmp6.patch23
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-nd6-6.patch86
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-protosw6x.patch23
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-binutils_link.patch37
-rw-r--r--sys-freebsd/freebsd-sources/freebsd-sources-6.2-r5.ebuild117
9 files changed, 417 insertions, 5 deletions
diff --git a/sys-freebsd/freebsd-sources/ChangeLog b/sys-freebsd/freebsd-sources/ChangeLog
index fc7d77afcfd8..850a7c065f41 100644
--- a/sys-freebsd/freebsd-sources/ChangeLog
+++ b/sys-freebsd/freebsd-sources/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for sys-freebsd/freebsd-sources
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.43 2009/01/08 17:55:02 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.44 2009/01/08 18:35:47 aballier Exp $
+
+*freebsd-sources-6.2-r5 (08 Jan 2009)
+
+ 08 Jan 2009; Alexis Ballier <aballier@gentoo.org>
+ +files/freebsd-sources-6.2-amd64.patch,
+ +files/freebsd-sources-6.2-arc4random6x.patch,
+ +files/freebsd-sources-6.2-icmp6.patch,
+ +files/freebsd-sources-6.2-nd6-6.patch,
+ +files/freebsd-sources-6.2-protosw6x.patch,
+ +files/freebsd-sources-7.0-binutils_link.patch,
+ +freebsd-sources-6.2-r5.ebuild:
+ Fix module symbols export with latest binutils, grab a bunch of security
+ fixes from security.freebsd.org.
08 Jan 2009; Alexis Ballier <aballier@gentoo.org>
-freebsd-sources-6.2.ebuild, -freebsd-sources-6.2-r1.ebuild,
diff --git a/sys-freebsd/freebsd-sources/Manifest b/sys-freebsd/freebsd-sources/Manifest
index d242974c7ccc..4570eb26307a 100644
--- a/sys-freebsd/freebsd-sources/Manifest
+++ b/sys-freebsd/freebsd-sources/Manifest
@@ -6,24 +6,31 @@ AUX freebsd-sources-6.0-flex-2.5.31.patch 826 RMD160 a93341cfba5ddbd8df777273591
AUX freebsd-sources-6.0-werror.patch 898 RMD160 41a6f582a70018f29c96c08a5853bcbf167157d0 SHA1 70145f3a065987daf2ceedb0e696ebbef669eecd SHA256 7fbd139296e98697c94dcc6a4cd4d926b057779cb2415cb62bbb881b8acf26e5
AUX freebsd-sources-6.1-ntfs.patch 1043 RMD160 0389ef971934db5b239d81ec016d94a21398c226 SHA1 03d8c702bbd6bd79f7b3cbe64f720487b87fa442 SHA256 2eb0e22bea267d7ac41c3dec81682d3cc1f1744316ea39342e2aaae1f2dca469
AUX freebsd-sources-6.2-EN-07:02.net.patch 615 RMD160 60ca8dd926916696785b7232e3d9ba467ca1ecd8 SHA1 77e9dbb5a651f140ab4c47cb6804ba4b073dbca0 SHA256 f6b22e6afacc2c5311cf26f8f890dc46dd41d50c7a4f94e6dafb0f4d340d53a0
+AUX freebsd-sources-6.2-amd64.patch 838 RMD160 c85ab4f93631de3bf1a3a9689f80b61ffc6237db SHA1 5acfc74631619d1c422ae5c9b5ac4adeed8b8da7 SHA256 40ab9a8ae6740f7df5925f7535506184baef3ccdd063549b27c23e38c43f3bf0
+AUX freebsd-sources-6.2-arc4random6x.patch 2340 RMD160 24d5f8adf89e7975ed5ced4255bac5015982917d SHA1 950f90f01c2e0865ab82898a7279866cb99e9a2e SHA256 cc9c765636ec31c46e15f6ac75422168d1c1431acc3a2265b40845e178c0e392
AUX freebsd-sources-6.2-debug-O2.patch 815 RMD160 ae2c83117b81b47589e7ee35096c94cc8eceb29b SHA1 8f20681d81b171d93005d72acfbdf19481f5100c SHA256 92a5070fbb6e951417bf83065c9f8ba11d3f5f2b17bc340f1c3080d54af52177
AUX freebsd-sources-6.2-dl_iterate_phdr.patch 1508 RMD160 b177f38755288c19a07bcf962e0fccd962c3a16c SHA1 7be2021de659a6d003eab9fdf2962d2e0ddcc7c5 SHA256 dad9ee18ab8fca2cef72f326231113f5ac5465127f6e6e046c715aed15fc715e
AUX freebsd-sources-6.2-gcc41.patch 16887 RMD160 8ca5a1a76db802ca3e833ad15796bdf337002cb1 SHA1 5d4cec24352e20200028a98700008e8388999b3e SHA256 b28f57d0c73cf31bcac6c8424b0bc9fb24b5652f11a3e85d8a4a40b376976fab
+AUX freebsd-sources-6.2-icmp6.patch 745 RMD160 68f80689607f4f2bfaeb66379e3727433ec48bb2 SHA1 fd3081604a1c99ef84c3d35912c4e58f7f2b7e5b SHA256 e85910990fea1f6a6c33a1e044f85b6835fab30a97cff835526695d391875c51
AUX freebsd-sources-6.2-ipv6.patch 2017 RMD160 8d17c7f99b13f6b53eab454aa1a0a4eb22c1de82 SHA1 ec3b429b750774a6aee93a68013a5d5769397399 SHA256 0ff78bb2ca2a8e025fb2edae56dbdb7ab1103e64bd0cd8754f569d23cfa1284d
+AUX freebsd-sources-6.2-nd6-6.patch 3314 RMD160 eef4523577650508efcf713221d6ba961b6067a9 SHA1 1ae05eec4ffba4a1d51273a85e1c8626c24648e5 SHA256 da16393d6f89b5f887aaae14b29c4dce5aa56dda1af01a5179fbdb07ab6852c0
AUX freebsd-sources-6.2-posix-monotonic-clock.patch 420 RMD160 117e2b8c50f9431abf1702528be305f445a05765 SHA1 73a0cd1bd823bb206d887e783a5a682f741d3591 SHA256 d3a2d2de234ede4f8c57989ef1d45b8a3e11fb5bb658d37a863eb8130bd90592
+AUX freebsd-sources-6.2-protosw6x.patch 1007 RMD160 4b79d58ea430f57bf226a93320240c000f117fa3 SHA1 1e5839d152c3f2d5a5dbcc9f13f7fb27669c759b SHA256 423b8be3b2ef6429c396f16b3f7ff2e901882cdbb1a97b491c75eb0690286e04
AUX freebsd-sources-6.2-random.patch 433 RMD160 c2ff203ee923ebca87330683e20df948f80e9d8d SHA1 781286fa19296e3e2432c0e54b800167fcde0f62 SHA256 21caeba5697febe4b9497e35cdb2b856020969a8a286e0be2e08b8c4653f8828
AUX freebsd-sources-6.2-sendfile.patch 1879 RMD160 05eb9b3da42aec109c1cad2d5a1b7a700b87505a SHA1 db9059bf3d6c4fa9260ce38844ff40ad54e0a5f6 SHA256 669c2260b545d8e1482cc6d4570551061d84b05ba26df67942bd9142767be60a
AUX freebsd-sources-6.2-sparc64.patch 504 RMD160 0ee148e9e565c03ca7e30122ac885f643081b50e SHA1 391bc1e25b18c3b32340cb65b45878aab9e033a0 SHA256 952addc69ac504f9d73d111eff7c7be51b6fb12dcedd65d563d8df533d88bbdf
AUX freebsd-sources-6.2-unp_gc.patch 6066 RMD160 a8eb464d7a41b394b190bc530532a4a8a7bdff48 SHA1 5c371253d81dd8b039413c8afa6ac9ad6b7ae27b SHA256 39ac44c64e5115b166bb2302512be5069c9d0b9405aadf312c219d49aece6882
+AUX freebsd-sources-7.0-binutils_link.patch 1312 RMD160 5840bdd76a505bd9bf61d3e6290a533c47bc9c40 SHA1 c144e70a9cecd4ece3d401482adf77bdd3633b0b SHA256 7be24739f5b55fb88f4807e58256fe32347c6c2c1a67df44c98c8d9e098c82a0
AUX freebsd-sources-gentoo.patch 1191 RMD160 1c8ce1849d767a995f075fe43b7313b341bd0805 SHA1 abe5d4ff186d1b9b6ad6d7af6be359563e81183b SHA256 e5e7186858259e7d6d21e925dde640a68b27255cf69ab089ee82675568e7d9a7
DIST freebsd-sys-6.2.tar.bz2 18344936 RMD160 784230e22ccaf09933ef3f053ff29cc3e579786a SHA1 161b7a4d165665deb1c4434c356b5f610a72a83a SHA256 a754371d88601aaab7152bb3d127bd3777db912e13a26a866e13ba34934c5e5b
EBUILD freebsd-sources-6.2-r4.ebuild 3301 RMD160 b2d8a7b6702151ad5e2c7a7d171f32b2335fbd0f SHA1 21a5b149e9f76bb4375e6de26659632650fd8900 SHA256 e69bd4a87fdbcfb0e22acaef8462d53dc4c0e892fa92069e1c4975ee0c6821c1
-MISC ChangeLog 11889 RMD160 42881925543ed5f6b8b9da19496b592908ddbd5c SHA1 6e38bbbc51945130c4eabf123237dcdd81a5d446 SHA256 715a0deb4ae34a82e8cf2eb01c8f41de3c113a671a3a734472cd797d2b71af17
+EBUILD freebsd-sources-6.2-r5.ebuild 3965 RMD160 4f877e3779c32711d781d8cd2ed579286c24ab3a SHA1 062afd930996a8bc037712584e9dcd041bf31bcd SHA256 59ff17393a1291a1d67000f1f66d7d4601c5cef644db4b9a0c7da56009ffb2fe
+MISC ChangeLog 12396 RMD160 b090893423a6e73433f24305c212ed15ee43cab4 SHA1 d24ecfe6d720fbb3099c0fe69033e335fc650121 SHA256 f72299183655c531638f11d03f93fa146f2aa97e0878ad82e24589257f47a25f
MISC metadata.xml 156 RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 SHA1 d9d9d4f2b5afc58339ea3e562fca490156935f1f SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
-iEYEARECAAYFAklmPfEACgkQvFcC4BYPU0rMywCgglw3/3WdnKR95gsRKlBqni2Q
-83MAn1vjv7k9zxIJyKusEpKVbMZeTWPK
-=ZL7v
+iEYEARECAAYFAklmR30ACgkQvFcC4BYPU0quwgCgt23NByPggV0Gr2XX0k4EWBGX
+zNsAn3M5jD/k63L6ITdvLzm3Jzfh6EwC
+=d/pA
-----END PGP SIGNATURE-----
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-amd64.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-amd64.patch
new file mode 100644
index 000000000000..9e910317cef2
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-amd64.patch
@@ -0,0 +1,25 @@
+Index: sys/amd64/amd64/exception.S
+===================================================================
+RCS file: /home/ncvs/src/sys/amd64/amd64/exception.S,v
+retrieving revision 1.132
+retrieving revision 1.133
+diff -u -d -r1.132 -r1.133
+--- sys/amd64/amd64/exception.S 24 May 2008 06:32:26 -0000 1.132
++++ sys/amd64/amd64/exception.S 18 Aug 2008 08:47:27 -0000 1.133
+@@ -636,13 +636,10 @@
+ .globl doreti_iret_fault
+ doreti_iret_fault:
+ subq $TF_RIP,%rsp /* space including tf_err, tf_trapno */
+- testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
+- jz 1f /* already running with kernel GS.base */
+- swapgs
+-1: testl $PSL_I,TF_RFLAGS(%rsp)
+- jz 2f
++ testl $PSL_I,TF_RFLAGS(%rsp)
++ jz 1f
+ sti
+-2: movq %rdi,TF_RDI(%rsp)
++1: movq %rdi,TF_RDI(%rsp)
+ movq %rsi,TF_RSI(%rsp)
+ movq %rdx,TF_RDX(%rsp)
+ movq %rcx,TF_RCX(%rsp)
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-arc4random6x.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-arc4random6x.patch
new file mode 100644
index 000000000000..1fda03c8f150
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-arc4random6x.patch
@@ -0,0 +1,81 @@
+Index: sys/dev/random/randomdev.c
+===================================================================
+--- sys/dev/random/randomdev.c (revision 185214)
++++ sys/dev/random/randomdev.c (working copy)
+@@ -89,6 +89,7 @@
+ && (securelevel_gt(td->td_ucred, 0) == 0)) {
+ (*random_systat.reseed)();
+ random_systat.seeded = 1;
++ arc4rand(NULL, 0, 1); /* Reseed arc4random as well. */
+ }
+
+ return (0);
+Index: sys/dev/random/randomdev_soft.c
+===================================================================
+--- sys/dev/random/randomdev_soft.c (revision 185214)
++++ sys/dev/random/randomdev_soft.c (working copy)
+@@ -61,6 +61,7 @@
+ u_int, u_int, enum esource);
+ static int random_yarrow_poll(int event,struct thread *td);
+ static int random_yarrow_block(int flag);
++static void random_yarrow_flush_reseed(void);
+
+ struct random_systat random_yarrow = {
+ .ident = "Software, Yarrow",
+@@ -70,7 +71,7 @@
+ .read = random_yarrow_read,
+ .write = random_yarrow_write,
+ .poll = random_yarrow_poll,
+- .reseed = random_yarrow_reseed,
++ .reseed = random_yarrow_flush_reseed,
+ .seeded = 1,
+ };
+
+@@ -96,7 +97,7 @@
+ /* Harvested entropy */
+ static struct entropyfifo harvestfifo[ENTROPYSOURCE];
+
+-/* <0 to end the kthread, 0 to let it run */
++/* <0 to end the kthread, 0 to let it run, 1 to flush the harvest queues */
+ static int random_kthread_control = 0;
+
+ static struct proc *random_kthread_proc;
+@@ -247,7 +248,7 @@
+ local_count = 0;
+
+ /* Process until told to stop */
+- for (; random_kthread_control == 0;) {
++ for (; random_kthread_control >= 0;) {
+
+ active = 0;
+
+@@ -282,6 +283,13 @@
+ KASSERT(local_count == 0, ("random_kthread: local_count %d",
+ local_count));
+
++ /*
++ * If a queue flush was commanded, it has now happened,
++ * and we can mark this by resetting the command.
++ */
++ if (random_kthread_control == 1)
++ random_kthread_control = 0;
++
+ /* Found nothing, so don't belabour the issue */
+ if (!active)
+ tsleep(&harvestfifo, 0, "-", hz / 10);
+@@ -406,3 +414,15 @@
+
+ return error;
+ }
++
++/* Helper routine to perform explicit reseeds */
++static void
++random_yarrow_flush_reseed(void)
++{
++ /* Command a entropy queue flush and wait for it to finish */
++ random_kthread_control = 1;
++ while (random_kthread_control)
++ tsleep(&harvestfifo, 0, "-", hz / 10);
++
++ random_yarrow_reseed();
++}
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-icmp6.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-icmp6.patch
new file mode 100644
index 000000000000..6b97b16b3f97
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-icmp6.patch
@@ -0,0 +1,23 @@
+Index: sys/netinet6/icmp6.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/icmp6.c,v
+retrieving revision 1.80.2.4
+diff -u -p -r1.80.2.4 icmp6.c
+--- sys/netinet6/icmp6.c 31 Aug 2008 21:54:24 -0000 1.80.2.4
++++ sys/netinet6/icmp6.c 1 Sep 2008 23:03:44 -0000
+@@ -1117,6 +1117,15 @@ icmp6_mtudisc_update(struct ip6ctlparam
+ if (!validated)
+ return;
+
++ /*
++ * In case the suggested mtu is less than IPV6_MMTU, we
++ * only need to remember that it was for above mentioned
++ * "alwaysfrag" case.
++ * Try to be as close to the spec as possible.
++ */
++ if (mtu < IPV6_MMTU)
++ mtu = IPV6_MMTU - 8;
++
+ bzero(&inc, sizeof(inc));
+ inc.inc_flags = 1; /* IPv6 */
+ inc.inc6_faddr = *dst;
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-nd6-6.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-nd6-6.patch
new file mode 100644
index 000000000000..dc32f71064f2
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-nd6-6.patch
@@ -0,0 +1,86 @@
+Index: sys/netinet6/in6.h
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/in6.h,v
+retrieving revision 1.36.2.9
+diff -u -p -r1.36.2.9 in6.h
+--- sys/netinet6/in6.h 1 Sep 2008 22:57:56 -0000 1.36.2.9
++++ sys/netinet6/in6.h 28 Sep 2008 21:27:09 -0000
+@@ -575,7 +575,8 @@ struct ip6_mtuinfo {
+ /* to define items, should talk with KAME guys first, for *BSD compatibility */
+ #define IPV6CTL_STEALTH 45
+ #define IPV6CTL_RTHDR0_ALLOWED 46
+-#define IPV6CTL_MAXID 47
++#define ICMPV6CTL_ND6_ONLINKNSRFC4861 47
++#define IPV6CTL_MAXID 48
+ #endif /* __BSD_VISIBLE */
+
+ /*
+Index: sys/netinet6/in6_proto.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/in6_proto.c,v
+retrieving revision 1.32.2.9
+diff -u -p -r1.32.2.9 in6_proto.c
+--- sys/netinet6/in6_proto.c 1 Sep 2008 22:57:56 -0000 1.32.2.9
++++ sys/netinet6/in6_proto.c 28 Sep 2008 21:26:24 -0000
+@@ -354,6 +354,7 @@ DOMAIN_SET(inet6);
+ #ifndef IPV6_SENDREDIRECTS
+ #define IPV6_SENDREDIRECTS 1
+ #endif
++int nd6_onlink_ns_rfc4861 = 0; /* allow 'on-link' nd6 NS (as in RFC 4861) */
+
+ int ip6_forwarding = IPV6FORWARDING; /* act as router? */
+ int ip6_sendredirects = IPV6_SENDREDIRECTS;
+@@ -553,3 +554,6 @@ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_N
+ nd6_maxnudhint, CTLFLAG_RW, &nd6_maxnudhint, 0, "");
+ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG,
+ nd6_debug, CTLFLAG_RW, &nd6_debug, 0, "");
++SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861,
++ nd6_onlink_ns_rfc4861, CTLFLAG_RW, &nd6_onlink_ns_rfc4861, 0,
++ "Accept 'on-link' nd6 NS in compliance with RFC 4861.");
+Index: sys/netinet6/nd6.h
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/nd6.h,v
+retrieving revision 1.19.2.3
+diff -u -p -r1.19.2.3 nd6.h
+--- sys/netinet6/nd6.h 1 Sep 2008 22:57:56 -0000 1.19.2.3
++++ sys/netinet6/nd6.h 28 Sep 2008 21:26:24 -0000
+@@ -339,6 +339,7 @@ extern struct llinfo_nd6 llinfo_nd6;
+ extern struct nd_drhead nd_defrouter;
+ extern struct nd_prhead nd_prefix;
+ extern int nd6_debug;
++extern int nd6_onlink_ns_rfc4861;
+
+ #define nd6log(x) do { if (nd6_debug) log x; } while (/*CONSTCOND*/ 0)
+
+Index: sys/netinet6/nd6_nbr.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/nd6_nbr.c,v
+retrieving revision 1.29.2.10
+diff -u -p -r1.29.2.10 nd6_nbr.c
+--- sys/netinet6/nd6_nbr.c 1 Sep 2008 22:57:56 -0000 1.29.2.10
++++ sys/netinet6/nd6_nbr.c 28 Sep 2008 21:26:24 -0000
+@@ -148,6 +148,24 @@ nd6_ns_input(m, off, icmp6len)
+ "(wrong ip6 dst)\n"));
+ goto bad;
+ }
++ } else if (!nd6_onlink_ns_rfc4861) {
++ struct sockaddr_in6 src_sa6;
++
++ /*
++ * According to recent IETF discussions, it is not a good idea
++ * to accept a NS from an address which would not be deemed
++ * to be a neighbor otherwise. This point is expected to be
++ * clarified in future revisions of the specification.
++ */
++ bzero(&src_sa6, sizeof(src_sa6));
++ src_sa6.sin6_family = AF_INET6;
++ src_sa6.sin6_len = sizeof(src_sa6);
++ src_sa6.sin6_addr = saddr6;
++ if (!nd6_is_addr_neighbor(&src_sa6, ifp)) {
++ nd6log((LOG_INFO, "nd6_ns_input: "
++ "NS packet from non-neighbor\n"));
++ goto bad;
++ }
+ }
+
+ if (IN6_IS_ADDR_MULTICAST(&taddr6)) {
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-protosw6x.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-protosw6x.patch
new file mode 100644
index 000000000000..f1a540c3e826
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-protosw6x.patch
@@ -0,0 +1,23 @@
+Index: sys/kern/uipc_domain.c
+===================================================================
+--- sys/kern/uipc_domain.c (revision 186366)
++++ sys/kern/uipc_domain.c (working copy)
+@@ -112,13 +112,18 @@
+
+ #define DEFAULT(foo, bar) if ((foo) == NULL) (foo) = (bar)
+ DEFAULT(pu->pru_accept, pru_accept_notsupp);
++ DEFAULT(pu->pru_bind, pru_bind_notsupp);
+ DEFAULT(pu->pru_connect, pru_connect_notsupp);
+ DEFAULT(pu->pru_connect2, pru_connect2_notsupp);
+ DEFAULT(pu->pru_control, pru_control_notsupp);
++ DEFAULT(pu->pru_disconnect, pru_disconnect_notsupp);
+ DEFAULT(pu->pru_listen, pru_listen_notsupp);
++ DEFAULT(pu->pru_peeraddr, pru_peeraddr_notsupp);
+ DEFAULT(pu->pru_rcvd, pru_rcvd_notsupp);
+ DEFAULT(pu->pru_rcvoob, pru_rcvoob_notsupp);
+ DEFAULT(pu->pru_sense, pru_sense_null);
++ DEFAULT(pu->pru_shutdown, pru_shutdown_notsupp);
++ DEFAULT(pu->pru_sockaddr, pru_sockaddr_notsupp);
+ DEFAULT(pu->pru_sosend, sosend);
+ DEFAULT(pu->pru_soreceive, soreceive);
+ DEFAULT(pu->pru_sopoll, sopoll);
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-binutils_link.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-binutils_link.patch
new file mode 100644
index 000000000000..132db2e42957
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-binutils_link.patch
@@ -0,0 +1,37 @@
+diff -ruN sys.orig/conf/kern.post.mk sys/conf/kern.post.mk
+--- sys.orig/conf/kern.post.mk 2007-03-23 18:55:59 -0300
++++ sys/conf/kern.post.mk 2008-06-18 19:51:13 -0300
+@@ -85,7 +85,9 @@
+ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
+ @rm -f ${.TARGET}
+ @echo linking ${.TARGET}
+- ${SYSTEM_LD}
++ ${SYSTEM_LD} -o ${.TARGET}.tmp
++ @sh $S/tools/gen-ld-u-options ${.TARGET}.tmp > ${.TARGET}.lopt
++ ${SYSTEM_LD} "@${.TARGET}.lopt"
+ .if !defined(DEBUG)
+ ${OBJCOPY} --strip-debug ${.TARGET}
+ .endif
+diff -ruN sys.orig/conf/kmod.mk sys/conf/kmod.mk
+--- sys.orig/conf/kmod.mk 2008-06-18 09:11:53 -0300
++++ sys/conf/kmod.mk 2008-06-18 19:50:01 -0300
+@@ -176,7 +176,8 @@
+
+ .if ${MACHINE_ARCH} != amd64
+ ${FULLPROG}: ${KMOD}.kld
+- ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
++ sh ./@/tools/gen-ld-u-options ${KMOD}.kld > ${KMOD}.lopt
++ ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld "@${KMOD}.lopt"
+ .if !defined(DEBUG_FLAGS)
+ ${OBJCOPY} --strip-debug ${.TARGET}
+ .endif
+diff -ruN sys.orig/tools/gen-ld-u-options sys/tools/gen-ld-u-options
+--- sys.orig/tools/gen-ld-u-options 1969-12-31 21:00:00 -0300
++++ sys/tools/gen-ld-u-options 2008-06-18 19:47:56 -0300
+@@ -0,0 +1,6 @@
++#!/bin/sh
++
++for i in `objdump -h -w $1 | grep set_ | cut -c5- | cut -f1 -d " "`
++do
++ echo -n " -u __start_$i -u __stop_$i "
++done
diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r5.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r5.ebuild
new file mode 100644
index 000000000000..5ad995cc19aa
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r5.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r5.ebuild,v 1.1 2009/01/08 18:35:47 aballier Exp $
+
+inherit bsdmk freebsd flag-o-matic
+
+DESCRIPTION="FreeBSD kernel sources"
+SLOT="${PVR}"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+
+IUSE="symlink"
+
+SRC_URI="mirror://gentoo/${SYS}.tar.bz2"
+
+RDEPEND=">=sys-freebsd/freebsd-mk-defs-6.0-r1"
+DEPEND=""
+
+RESTRICT="strip binchecks"
+
+S="${WORKDIR}/sys"
+
+MY_PVR="${PVR}"
+
+[[ ${MY_PVR} == "${RV}" ]] && MY_PVR="${MY_PVR}-r0"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # This replaces the gentoover patch, it doesn't need reapply every time.
+ sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \
+ -e 's:^BRANCH=.*:BRANCH="Gentoo":' \
+ -e 's:^VERSION=.*:VERSION="${TYPE} ${BRANCH} ${REVISION}":' \
+ "${S}/conf/newvers.sh"
+
+ epatch "${FILESDIR}/${PN}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
+ epatch "${FILESDIR}/${PN}-6.0-asm.patch"
+ epatch "${FILESDIR}/${PN}-6.0-werror.patch"
+ epatch "${FILESDIR}/${PN}-6.2-gcc41.patch"
+ epatch "${FILESDIR}/${PN}-6.2-sparc64.patch"
+ epatch "${FILESDIR}/${PN}-6.1-ntfs.patch"
+ epatch "${FILESDIR}/${PN}-6.2-debug-O2.patch"
+ epatch "${FILESDIR}/${PN}-6.2-dl_iterate_phdr.patch"
+ epatch "${FILESDIR}/${PN}-6.2-posix-monotonic-clock.patch"
+
+ # Errata patches
+ epatch "${FILESDIR}/${P}-EN-07:02.net.patch"
+ epatch "${FILESDIR}/${P}-unp_gc.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-07:03.ipv6.asc
+ epatch "${FILESDIR}/${P}-ipv6.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-07:09.random.asc
+ epatch "${FILESDIR}/${P}-random.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:03.sendfile.asc
+ epatch "${FILESDIR}/${P}-sendfile.patch"
+
+ # Fix modules symbol export with latest binutils
+ epatch "${FILESDIR}/${PN}-7.0-binutils_link.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:07.amd64.asc
+ epatch "${FILESDIR}/${P}-amd64.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:09.icmp6.asc
+ epatch "${FILESDIR}/${P}-icmp6.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:10.nd6.asc
+ epatch "${FILESDIR}/${P}-nd6-6.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:11.arc4random.asc
+ epatch "${FILESDIR}/${P}-arc4random6x.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-08:13.protosw.asc
+ epatch "${FILESDIR}/${P}-protosw6x.patch"
+
+ # Disable SSP for the kernel
+ grep -Zlr -- -ffreestanding "${S}" | xargs -0 sed -i -e \
+ "s:-ffreestanding:-ffreestanding $(test-flags -fno-stack-protector -fno-stack-protector-all):g"
+}
+
+src_compile() {
+ einfo "Nothing to compile.."
+}
+
+src_install() {
+ insinto "/usr/src/sys-${MY_PVR}"
+ doins -r "${S}/"*
+}
+
+pkg_postinst() {
+ if [[ ! -L "${ROOT}/usr/src/sys" ]]; then
+ einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${MY_PVR}..."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ # just in case...
+ [[ -L ""${ROOT}/usr/src/sys-${RV}"" ]] && rm "${ROOT}/usr/src/sys-${RV}"
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ elif use symlink; then
+ einfo "Updating /usr/src/sys symlink to sys-${MY_PVR}..."
+ rm "${ROOT}/usr/src/sys" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't remove previous symlinks, please fix manually."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ fi
+
+ if use sparc-fbsd ; then
+ ewarn "WARNING: kldload currently causes kernel panics"
+ ewarn "on sparc64. This is probably a gcc-4.1 issue, but"
+ ewarn "we need gcc-4.1 to compile the kernel correctly :/"
+ ewarn "Please compile all modules you need into the kernel"
+ fi
+}