From 56bd759df1d0c750a065b8c845e93d5dfa6b549d Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 8 Aug 2015 13:49:04 -0700 Subject: proj/gentoo: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson X-Thanks: Alec Warner - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring - wrote much python to improve cvs2svn X-Thanks: Rich Freeman - validation scripts X-Thanks: Patrick Lauer - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed --- sys-freebsd/freebsd-sources/Manifest | 14 ++ sys-freebsd/freebsd-sources/files/config-GENTOO | 4 + .../files/freebsd-sources-10.0-gentoo.patch | 22 +++ .../files/freebsd-sources-10.1-gcc48.patch | 18 +++ .../files/freebsd-sources-6.0-flex-2.5.31.patch | 22 +++ .../files/freebsd-sources-6.1-ntfs.patch | 32 ++++ .../freebsd-sources-7.0-tmpfs_whiteout_stub.patch | 44 ++++++ .../files/freebsd-sources-7.1-binutils_link.patch | 37 +++++ .../files/freebsd-sources-7.1-includes.patch | 13 ++ .../files/freebsd-sources-7.1-types.h-fix.patch | 15 ++ .../files/freebsd-sources-7.2-debug-O2.patch | 27 ++++ .../files/freebsd-sources-8.0-gentoo.patch | 33 ++++ .../freebsd-sources-8.0-subnet-route-pr40133.patch | 21 +++ .../files/freebsd-sources-8.2-unix2.patch | 55 +++++++ .../freebsd-sources-9.0-disable-optimization.patch | 32 ++++ .../files/freebsd-sources-9.0-ipv6refcount.patch | 128 ++++++++++++++++ .../files/freebsd-sources-9.0-sysctluint.patch | 13 ++ .../files/freebsd-sources-9.1-ciss.patch | 65 ++++++++ .../files/freebsd-sources-9.1-cve-2013-3077.patch | 26 ++++ .../files/freebsd-sources-9.1-cve-2013-3266.patch | 13 ++ .../files/freebsd-sources-9.1-cve-2013-5209.patch | 19 +++ .../files/freebsd-sources-9.1-cve-2013-5691.patch | 89 +++++++++++ .../files/freebsd-sources-9.1-cve-2013-5710.patch | 28 ++++ .../files/freebsd-sources-9.1-cve-2014-1453.patch | 70 +++++++++ .../files/freebsd-sources-9.1-exec.patch | 66 ++++++++ .../files/freebsd-sources-9.1-gentoo.patch | 21 +++ .../files/freebsd-sources-9.1-ktrace.patch | 12 ++ .../files/freebsd-sources-9.1-mmap-2014.patch | 20 +++ .../files/freebsd-sources-9.1-mmap.patch | 20 +++ .../files/freebsd-sources-9.1-nfsserver.patch | 16 ++ .../files/freebsd-sources-9.1-random.patch | 27 ++++ .../files/freebsd-sources-9.1-tcp.patch | 32 ++++ .../files/freebsd-sources-9.2-gentoo-gcc.patch | 13 ++ .../files/freebsd-sources-cve-2012-0217.patch | 26 ++++ .../freebsd-sources/freebsd-sources-10.1-r6.ebuild | 166 +++++++++++++++++++++ .../freebsd-sources/freebsd-sources-8.2-r2.ebuild | 109 ++++++++++++++ .../freebsd-sources/freebsd-sources-9.1-r3.ebuild | 84 +++++++++++ .../freebsd-sources/freebsd-sources-9.1-r9.ebuild | 97 ++++++++++++ sys-freebsd/freebsd-sources/metadata.xml | 10 ++ 39 files changed, 1559 insertions(+) create mode 100644 sys-freebsd/freebsd-sources/Manifest create mode 100644 sys-freebsd/freebsd-sources/files/config-GENTOO create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-10.0-gentoo.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-10.1-gcc48.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-6.0-flex-2.5.31.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-ntfs.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-includes.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-7.2-debug-O2.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-gentoo.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-subnet-route-pr40133.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-8.2-unix2.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-disable-optimization.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-ipv6refcount.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-sysctluint.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ciss.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3077.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3266.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5209.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5691.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5710.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2014-1453.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-exec.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-gentoo.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ktrace.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap-2014.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-nfsserver.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-random.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-9.2-gentoo-gcc.patch create mode 100644 sys-freebsd/freebsd-sources/files/freebsd-sources-cve-2012-0217.patch create mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-10.1-r6.ebuild create mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-8.2-r2.ebuild create mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-9.1-r3.ebuild create mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-9.1-r9.ebuild create mode 100644 sys-freebsd/freebsd-sources/metadata.xml (limited to 'sys-freebsd/freebsd-sources') diff --git a/sys-freebsd/freebsd-sources/Manifest b/sys-freebsd/freebsd-sources/Manifest new file mode 100644 index 000000000000..9a9ad1cc1128 --- /dev/null +++ b/sys-freebsd/freebsd-sources/Manifest @@ -0,0 +1,14 @@ +DIST freebsd-sources-9.1-en-13-03.patch 32571 SHA256 8bafbaba1b23f4651a9e578dbbb3b8d9b4a0a28dc1702f6dc17a40728b861595 SHA512 013a21da3618da9098020c85abe42d99e4eeb8d6b9b818cd5c6d27ee2ea2d31b60ad4521e73cb996f2f5c99fd0f34bd4a35458977264c51e79f4f53bfca6e7cc WHIRLPOOL c7b0a56efd9cebecde56590cacb1ee743845ce13577505255deca44c167d679ce94c759cfb363c26a5f2a9fc16dfc06d17eea18d638fd72c21ec0fdd81a71c5f +DIST freebsd-sources-EN-1501-vt.patch 877 SHA256 0dccdea4622599a50010a5dc7ebd411ad4c662e4a0f387f6faf43550269e9c61 SHA512 caf4b7587d3555aea8291578de03bb158e71ffa42ec323fd8736ea9b690eeac42084d8909a97ea39352573bb78e97fb4f367f2968e70970d68006c82726329a1 WHIRLPOOL a4ca24f7a91e98a97ba2b0d9a5e7c6297baf7ed501582d3f70b180cf596d6d4ccf058b1843abb60c448f17e95ed68ae0d1efa7deff0269c76abadfd3ede0533a +DIST freebsd-sources-EN-1505-ufs.patch 9811 SHA256 a589df05e8532bbe302282ba11e9d6caa50107b1673291218be48241ac3bcc3a SHA512 f24786afa6fafce28ec7221a71cc879119d0fa06a63e3c051aa7ecd609ed58360421b41918208d5182ab95a81da6ecdff6070d7b7ca6a2263aff3ce95c87ca26 WHIRLPOOL 0618d6c72c6980efe4169a02fc221aed072c0fdca22499457f90b64b31248390d2de2b5d845fed33f328cd3a36a03899a6b19857047f8ee1e087f03e7b4559a4 +DIST freebsd-sources-EN-1507-zfs.patch 9487 SHA256 53746175c99e358473c4d299a808b1c686c0ebc6b6d205b6f0a90bd70de17c47 SHA512 bac26f621406a3e372f8f1be6bc69d096657e95294b3fc603bf60d786d6968f2661e7a1e4321d745afdbe02193b676c6a855ce11d45a9742f7c1977572ed682a WHIRLPOOL 83b8724089df65365c2c5c53c351241958bb33408cc9f70588a028090a097302774d910b9c4509823c6f2091b4296dde600f2546c3207f6ea4f8fc699d4cede2 +DIST freebsd-sources-SA-1502-sctp.patch 2097 SHA256 c8ade882a39dd8f65c34b175457cdd93be6eafea67ffb5f977435d48a19b6b68 SHA512 b233ae1d249bdbf516aba611d081a5a6ccaaab32f9e281cce65136c68c6a47362eac33398d6849a45e4e1c30f02a482287d6339069d29ece0aa5c4d9101e24a4 WHIRLPOOL 4713b4d896c561d47686b9f1d53a7e3c912fc58c8039529f0ae244b2cc533aabf20f386a1f9bc8632849ebd084d3739b6be55d4f39a00d484d5d230755497b69 +DIST freebsd-sources-SA-1503-sctp.patch 4181 SHA256 61b5e717e88671ecc3da9c2b11d4c6d5ddc26f529ed19cb8ce588743cd00af9d SHA512 30deeb82af385abb0b57cc02752e72d8dda37688df99038910f04558ab064624cb576b1989ba8a7674e3a9046f9607be90596d9bdfb2f28900568291b0f96717 WHIRLPOOL 1073a364805b0ef8377dae6e3cd1665de6e4e99612549081fd794a4d92b4b4ee583a68e66f089340dc35129e3fb0bcf00b14b5b71304b6dac744d9a852530fbe +DIST freebsd-sources-SA-1504-igmp-errata.patch 1105 SHA256 de2a7a42a8212754f716629e52e1572f7bd7b274dfd999bda680ba813bcbf54e SHA512 89f3627bdbaa31c5e3b189bc6bb914bff69e54d3f6bf8caaa24f4067db3aba48d8b901146c7eeb186da5426ff7c9e9229ff9ef197bbd45f8bf1011348c30343c WHIRLPOOL aea0b508c992740094599c516aa6987c1a47c302ffb4a3a0f31b66148f63a21b76921be393caf9c10840152dc6bb4aa4d64e7e65725cc9c00a643e8f3d926957 +DIST freebsd-sources-SA-1504-igmp.patch 463 SHA256 969674297e3afbacbd3e15fc6621c813149ab044964d47b936761f04f8ff0bd6 SHA512 5668d18c0abcaad53547394bca18fa1060372cd7f59fd35265778ad74bd331ed08fd8c0b0e48fb338bf8d08c427af1b40315855c7d83c9e3c1917b2f22de1f92 WHIRLPOOL ca93b5f794aac22a23c0e14853813439ce9e0a26847aeec3498bf01c7e10cc1829ddde1a2d5d1291bf2a610773846bfef9217199da1a249d4e7df9f4e44a3e46 +DIST freebsd-sources-SA-1509-ipv6.patch 872 SHA256 318babf3961a2b99ea5453a5e2b65e4918279110b8c59ee54741ec4d689de227 SHA512 15a938c0c092bd7d40417d18c57401b0e0fea3c9a5976dea55e1fd2329ac5987016a719c7d8a078ce950b49b2096a26a058b5f7c7ba525430a975ab8fe68cb64 WHIRLPOOL 271b0750ddd3a8a88c18dc4e97e601f68419b6ff3ba9d4c0f5611153e945ecbcaea586ed8bb740ab00836370951ba977dc65739b55984fa5e08ecb70079d309d +DIST freebsd-sources-SA-1513-tcp.patch 1083 SHA256 7ce30ae71433508c056366bdd91b62e0e6ad03bd8a1f41e71355506226a8df20 SHA512 5b76aec9844f83e1570392acef5f7336bcf12dc3582ea7ef7327c749941c6cd84d5000c482b4cfcd1d5af0a258c5b91623e4c0dd6edc010e518ee81b5e0ee2dd WHIRLPOOL ccc00d6f196d907f234fe1add9b2bc487e950ec0fa94de531762ddc10364a2491e6055f0bd587ec9e669d8a83b2d640e4e1fe125bacf475002b8efc1285e5a3b +DIST freebsd-sources-SA-1515-tcp-9.3-10.1.patch 6546 SHA256 8173a1a7f28140ba9876da3bc26ad2ccf48af388e88619fafefc3e07b28fe09c SHA512 391a365098ea18815619d9fecdc452a49e1ab0546a9c0fb3666f7240539b309dcb583db5a58dbc43b729dfcaaac259effe13a00601c2771f35f3757d251b62ae WHIRLPOOL d0385a5106330a4bc374e10bca73a2678eec4adb8ba01656449004e139c370a9535960dd3d7ee4c051035fe6fc77d4bd39b4a14fd961eaed8ebb64089deace84 +DIST freebsd-src-10.1.tar.xz 115049476 SHA256 f919287a5ef51d4f133f27c99c54f2e8054f408d3dd53bc60f4e233cc75ec03d SHA512 4ded32b451e2807e24a06305502f88ea633b2899a7ccd9cab3dc98fc865ef91324c93c512a08cf6e295313a8d7e79aa9d7af07da40e7276d986b06419b984152 WHIRLPOOL 1eff9419d89b8a70f064171883d92e160b250cd637972eb9107a19d7b3c904b554c4f51eaa9ff9642ef2c4234bde05cf9aef16d0c39280b55084f831700dea80 +DIST freebsd-sys-8.2.tar.bz2 25835329 SHA256 0c6c7b61aae94db2931f985d5899f3bca78fc8ffab6b598fbaa158142d676f16 SHA512 6ea4516a5c52e25c4f993f7acb875463a5caea93dbdf250c5d48eee95fff226956e9f030cab7e341b5e6a132325bc3dbf93dcb4b1185acb011918e50b1a22be3 WHIRLPOOL 870deeff877c6b9fc812a4260e4fdbb6715a5dc2065cab3bfbf2a42d876f6654703ccb124275a4e2c410cef48f3db02b63cc76059eccf9cf90244826f35b7a15 +DIST freebsd-sys-9.1.tar.bz2 32588103 SHA256 b93a7ac8334ac16cc9f60665048e5ef812c0a6c62f10d0b0a674aec3f56516a8 SHA512 7dc9d9e00dde8f592bb171f4386d02b655b73cb4f153fe5ec063d010a148ef0639eae0dcdb3eeb09ecd1e3653c69e49a2d261329fa6d0381d2ddabe258ddde6d WHIRLPOOL c8348344dfb14bad64bd3a78ee615ddd29203175b292233254f8ba175e7a3fb7218af6f95f7b4dbf394c0354bafe9d8bb0c21cdf0ceaeb697214964b280469b3 diff --git a/sys-freebsd/freebsd-sources/files/config-GENTOO b/sys-freebsd/freebsd-sources/files/config-GENTOO new file mode 100644 index 000000000000..7c7eb26cccc2 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/config-GENTOO @@ -0,0 +1,4 @@ +# Kernel configuration for Gentoo/FreeBSD. +include GENERIC +ident GENTOO + diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-10.0-gentoo.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-10.0-gentoo.patch new file mode 100644 index 000000000000..c7e12bdf8a4e --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-10.0-gentoo.patch @@ -0,0 +1,22 @@ +diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk +index 2939a59..124ef6f 100644 +--- a/sys/conf/kern.mk ++++ b/sys/conf/kern.mk +@@ -5,7 +5,7 @@ + # + CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ +- -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \ ++ -Wundef -Wno-pointer-sign \ + -Wmissing-include-dirs -fdiagnostics-show-option \ + ${CWARNEXTRA} + # +@@ -61,7 +61,7 @@ FORMAT_EXTENSIONS= -fformat-extensions + # + .if ${MACHINE_CPUARCH} == "i386" + .if ${COMPILER_TYPE} != "clang" +-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 ++CFLAGS+= -mpreferred-stack-boundary=2 + .else + CFLAGS+= -mno-aes -mno-avx + .endif diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-10.1-gcc48.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-10.1-gcc48.patch new file mode 100644 index 000000000000..5cb4cf809b12 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-10.1-gcc48.patch @@ -0,0 +1,18 @@ +https://svnweb.freebsd.org/base?view=revision&revision=281606 + +diff --git a/sys/crypto/aesni/aesencdec.h b/sys/crypto/aesni/aesencdec.h +index d4ed8b3..79847ee 100644 +--- a/sys/crypto/aesni/aesencdec.h ++++ b/sys/crypto/aesni/aesencdec.h +@@ -27,6 +27,11 @@ + * + */ + ++#if defined(__GNUC__) && defined(_KERNEL) ++/* Suppress inclusion of gcc's mm_malloc.h header */ ++#define _MM_MALLOC_H_INCLUDED 1 ++#endif ++ + #include + + static inline void diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.0-flex-2.5.31.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.0-flex-2.5.31.patch new file mode 100644 index 000000000000..88710cf69dd8 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.0-flex-2.5.31.patch @@ -0,0 +1,22 @@ +Index: fbsd-6/sys/dev/aic7xxx/aicasm/aicasm_scan.l +=================================================================== +--- fbsd-6.orig/sys/dev/aic7xxx/aicasm/aicasm_scan.l ++++ fbsd-6/sys/dev/aic7xxx/aicasm/aicasm_scan.l +@@ -528,7 +528,7 @@ expand_macro(struct symbol *macro_symbol + + /* Put back everything up until the replacement. */ + while (body_pos > next_match) +- unput(*--body_pos); ++ yyunput(*--body_pos, body_head); + + /* Perform the replacement. */ + if (match_marg != NULL) { +@@ -537,7 +537,7 @@ expand_macro(struct symbol *macro_symbol + next_match = match_marg->replacement_text; + strp = next_match + strlen(next_match); + while (strp > next_match) +- unput(*--strp); ++ yyunput(*--strp, next_match); + + /* Skip past the unexpanded macro arg. */ + body_pos -= match.rm_eo - match.rm_so; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-ntfs.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-ntfs.patch new file mode 100644 index 000000000000..e74fcd3f9b88 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.1-ntfs.patch @@ -0,0 +1,32 @@ +--- sys/fs/ntfs/ntfs_vnops.c.orig 2006-10-17 17:31:36 -0300 ++++ sys/fs/ntfs/ntfs_vnops.c 2006-10-17 17:30:24 -0300 +@@ -507,8 +507,12 @@ + + /* Simulate . in every dir except ROOT */ + if( ip->i_number != NTFS_ROOTINO ) { +- struct dirent dot = { NTFS_ROOTINO, +- sizeof(struct dirent), DT_DIR, 1, "." }; ++ struct dirent dot; ++ dot.d_fileno = NTFS_ROOTINO; ++ dot.d_reclen = sizeof(struct dirent); ++ dot.d_type = DT_DIR; ++ dot.d_namlen = 1; ++ bcopy(".", dot.d_name, 1); + + if( uio->uio_offset < sizeof(struct dirent) ) { + dot.d_fileno = ip->i_number; +@@ -522,8 +526,12 @@ + + /* Simulate .. in every dir including ROOT */ + if( uio->uio_offset < 2 * sizeof(struct dirent) ) { +- struct dirent dotdot = { NTFS_ROOTINO, +- sizeof(struct dirent), DT_DIR, 2, ".." }; ++ struct dirent dotdot; ++ dotdot.d_fileno = NTFS_ROOTINO; ++ dotdot.d_reclen = sizeof(struct dirent); ++ dotdot.d_type = DT_DIR; ++ dotdot.d_namlen = 2; ++ bcopy("..", dotdot.d_name, 2); + + error = uiomove((char *)&dotdot,sizeof(struct dirent),uio); + if(error) diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch new file mode 100644 index 000000000000..13524efa6e00 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch @@ -0,0 +1,44 @@ +diff -ur sys/fs/tmpfs.orig/tmpfs_vnops.c sys/fs/tmpfs/tmpfs_vnops.c +--- sys/fs/tmpfs.orig/tmpfs_vnops.c 2008-06-22 12:17:48 -0300 ++++ sys/fs/tmpfs/tmpfs_vnops.c 2008-06-28 12:05:10 -0300 +@@ -1459,6 +1459,30 @@ + return (0); + } + ++ ++/* --------------------------------------------------------------------- */ ++/* This does absolutely nothing */ ++#ifdef GENTOO_LIVECD ++static int ++tmpfs_whiteout(struct vop_whiteout_args *ap) ++{ ++ switch (ap->a_flags) { ++ case LOOKUP: ++ return (0); ++ break; ++ case CREATE: ++ return(EOPNOTSUPP); ++ break; ++ case DELETE: ++ return (0); ++ break; ++ default: ++ return(EOPNOTSUPP); ++ } ++ return(0); ++} ++#endif ++ + /* --------------------------------------------------------------------- */ + + /* +@@ -1484,6 +1508,9 @@ + .vop_mkdir = tmpfs_mkdir, + .vop_rmdir = tmpfs_rmdir, + .vop_symlink = tmpfs_symlink, ++#ifdef GENTOO_LIVECD ++ .vop_whiteout = tmpfs_whiteout, ++#endif + .vop_readdir = tmpfs_readdir, + .vop_readlink = tmpfs_readlink, + .vop_inactive = tmpfs_inactive, diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch new file mode 100644 index 000000000000..43d01baef347 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-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(CTFMERGE) + ${SYSTEM_CTFMERGE} + .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/files/freebsd-sources-7.1-includes.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-includes.patch new file mode 100644 index 000000000000..3db46fa1d7e3 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-includes.patch @@ -0,0 +1,13 @@ +Make headers usable alone, include the headers they need. +There are probably much more missing. + +--- sys/net/if.h.old 2009-05-15 10:51:50 +0000 ++++ sys/net/if.h 2009-05-15 10:52:05 +0000 +@@ -34,6 +34,7 @@ + #define _NET_IF_H_ + + #include ++#include + + #ifdef _KERNEL + #include diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch new file mode 100644 index 000000000000..8de5df2d16a6 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch @@ -0,0 +1,15 @@ +Fixes a compile error if XOPEN_SOURCE 600 is defined. + +See: http://www.mailinglistarchive.com/freebsd-current@freebsd.org/msg15011.html + +--- sys/sys/types.h.orig ++++ sys/sys/types.h +@@ -46,7 +46,7 @@ + + #include + +-#if __BSD_VISIBLE ++#ifndef _POSIX_SOURCE + typedef unsigned char u_char; + typedef unsigned short u_short; + typedef unsigned int u_int; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.2-debug-O2.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.2-debug-O2.patch new file mode 100644 index 000000000000..4fa3565207ec --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.2-debug-O2.patch @@ -0,0 +1,27 @@ +My UltraSPARC U5 panics on boot about a memory alignment error when compiled +with gcc4 and -O. Compiling with -O2 fixes this, and it should not adversly +affect debugging. + +NOTE: This does not fix the memory alignment panic when loading kernel modules. + +Roy Marples (uberlord@gentoo.org) + +--- sys/conf/kern.pre.mk.old 2009-05-22 10:09:46 +0000 ++++ sys/conf/kern.pre.mk 2009-05-22 10:10:27 +0000 +@@ -22,15 +22,13 @@ + COPTFLAGS?= -O + .else + . if defined(DEBUG) +-_MINUS_O= -O + CTFFLAGS+= -g + . else +-_MINUS_O= -O2 + . endif + . if ${MACHINE_ARCH} == "amd64" + COPTFLAGS?=-O2 -frename-registers -pipe + . else +-COPTFLAGS?=${_MINUS_O} -pipe ++COPTFLAGS?=-O2 -pipe + . endif + . if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) + COPTFLAGS+= -fno-strict-aliasing diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-gentoo.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-gentoo.patch new file mode 100644 index 000000000000..0f8d070e9a31 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-gentoo.patch @@ -0,0 +1,33 @@ +--- sys/conf/kern.mk.old 2007-05-24 23:53:42.000000000 +0200 ++++ sys/conf/kern.mk 2008-03-14 14:37:47.216420518 +0100 +@@ -12,7 +12,7 @@ + .else + CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ +- ${_wundef} ${_Wno_pointer_sign} -fformat-extensions ++ ${_wundef} ${_Wno_pointer_sign} + .if !defined(WITH_GCC3) + _Wno_pointer_sign=-Wno-pointer-sign + .endif +@@ -36,7 +36,7 @@ + # reserved for user applications. + # + .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc" +-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \ ++CFLAGS+= -mpreferred-stack-boundary=2 \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 + INLINE_LIMIT?= 8000 + .endif +Only in ./sys/conf: kern.mk.rej +Only in ./sys/conf: kern.mk~ +--- sys/dev/aic7xxx/aicasm/Makefile.old 2010-03-10 14:01:50 +0100 ++++ sys/dev/aic7xxx/aicasm/Makefile 2010-03-10 14:01:56 +0100 +@@ -14,7 +14,7 @@ + SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS} + CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} + DPADD= ${LIBL} +-LDADD= -ll ++LDADD= -lfl + WARNS?= 6 + + # Correct path for kernel builds diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-subnet-route-pr40133.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-subnet-route-pr40133.patch new file mode 100644 index 000000000000..a7335f6d427f --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.0-subnet-route-pr40133.patch @@ -0,0 +1,21 @@ +Fixes changing the default subnet route after removing an ip address. + +See: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40133 +and http://mail-index.netbsd.org/tech-net/2008/12/03/msg000896.html + +Thanks to Roy Marples. +--- sys/netinet/in.c.orig ++++ sys/netinet/in.c +@@ -858,6 +858,12 @@ + error = rtinit(&target->ia_ifa, (int)RTM_ADD, flags); + if (!error) + target->ia_flags |= IFA_ROUTE; ++ else if (error == EEXIST) { ++ /* ++ * the fact that the route already exists is not an error. ++ */ ++ error = 0; ++ } + return (error); + } + diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-8.2-unix2.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.2-unix2.patch new file mode 100644 index 000000000000..50dacd0e5a49 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-8.2-unix2.patch @@ -0,0 +1,55 @@ +Index: sys/kern/uipc_usrreq.c +=================================================================== +--- sys/kern/uipc_usrreq.c (revision 225745) ++++ sys/kern/uipc_usrreq.c (working copy) +@@ -462,6 +462,8 @@ + unp = sotounpcb(so); + KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + ++ if (soun->sun_len > sizeof(struct sockaddr_un)) ++ return (EINVAL); + namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); + if (namelen <= 0) + return (EINVAL); +@@ -1252,6 +1254,8 @@ + unp = sotounpcb(so); + KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + ++ if (nam->sa_len > sizeof(struct sockaddr_un)) ++ return (EINVAL); + len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); + if (len <= 0) + return (EINVAL); +Index: sys/compat/linux/linux_socket.c +=================================================================== +--- sys/compat/linux/linux_socket.c (revision 225919) ++++ sys/compat/linux/linux_socket.c (working copy) +@@ -104,6 +104,7 @@ + int oldv6size; + struct sockaddr_in6 *sin6; + #endif ++ int namelen; + + if (*osalen < 2 || *osalen > UCHAR_MAX || !osa) + return (EINVAL); +@@ -166,6 +167,20 @@ + } + } + ++ if ((bdom == AF_LOCAL) && (*osalen > sizeof(struct sockaddr_un))) { ++ for (namelen = 0; ++ namelen < *osalen - offsetof(struct sockaddr_un, sun_path); ++ namelen++) ++ if (!((struct sockaddr_un *)kosa)->sun_path[namelen]) ++ break; ++ if (namelen + offsetof(struct sockaddr_un, sun_path) > ++ sizeof(struct sockaddr_un)) { ++ error = EINVAL; ++ goto out; ++ } ++ alloclen = sizeof(struct sockaddr_un); ++ } ++ + sa = (struct sockaddr *) kosa; + sa->sa_family = bdom; + sa->sa_len = alloclen; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-disable-optimization.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-disable-optimization.patch new file mode 100644 index 000000000000..4824ff6e1a09 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-disable-optimization.patch @@ -0,0 +1,32 @@ +Taken from debian GNU/kFreeBSD. + +Regretably, with GCC 4.4 or later this is the only flag combination +I could find that doesn't cause kernel panics CPU triple-faults or +other kind of severe breakage. This is Gentoo Bug #410945. + +Clang can use -O2, so we do not force -O1 on it + +--- a/sys/conf/kern.pre.mk ++++ b/sys/conf/kern.pre.mk +@@ -41,6 +41,9 @@ + .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) + COPTFLAGS+= -fno-strict-aliasing + .endif ++.if ${CC:T:Mclang} != "clang" && !empty(COPTFLAGS:M-O[23s]) ++COPTFLAGS+= -O1 ++.endif + .if !defined(NO_CPU_COPTFLAGS) + COPTFLAGS+= ${_CPUCFLAGS} + .endif +--- a/sys/conf/kmod.mk ++++ b/sys/conf/kmod.mk +@@ -91,6 +91,9 @@ + .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) + CFLAGS+= -fno-strict-aliasing + .endif ++.if ${CC:T:Mclang} != "clang" && !empty(CFLAGS:M-O[23s]) ++CFLAGS+= -O1 ++.endif + WERROR?= -Werror + CFLAGS+= ${WERROR} + CFLAGS+= -D_KERNEL diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-ipv6refcount.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-ipv6refcount.patch new file mode 100644 index 000000000000..f0984f6776c8 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-ipv6refcount.patch @@ -0,0 +1,128 @@ +Index: sys/netinet6/in6.c +=================================================================== +--- sys/netinet6/in6.c.orig ++++ sys/netinet6/in6.c +@@ -1369,6 +1369,8 @@ in6_purgeaddr(struct ifaddr *ifa) + } + + cleanup: ++ if (ifa0 != NULL) ++ ifa_free(ifa0); + + plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ + if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { +@@ -1393,8 +1395,6 @@ cleanup: + return; + ia->ia_flags &= ~IFA_ROUTE; + } +- if (ifa0 != NULL) +- ifa_free(ifa0); + + in6_unlink_ifa(ia, ifp); + } +@@ -1667,14 +1667,19 @@ in6_lifaddr_ioctl(struct socket *so, u_long cmd, c + hostid = IFA_IN6(ifa); + + /* prefixlen must be <= 64. */ +- if (64 < iflr->prefixlen) ++ if (64 < iflr->prefixlen) { ++ if (ifa != NULL) ++ ifa_free(ifa); + return EINVAL; ++ } + prefixlen = iflr->prefixlen; + + /* hostid part must be zero. */ + sin6 = (struct sockaddr_in6 *)&iflr->addr; + if (sin6->sin6_addr.s6_addr32[2] != 0 || + sin6->sin6_addr.s6_addr32[3] != 0) { ++ if (ifa != NULL) ++ ifa_free(ifa); + return EINVAL; + } + } else +@@ -2265,14 +2265,20 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr + IN6_IFADDR_RUNLOCK(); + return (struct in6_ifaddr *)ifa; + } +- IN6_IFADDR_RUNLOCK(); + + /* use the last-resort values, that are, deprecated addresses */ +- if (dep[0]) ++ if (dep[0]) { ++ ifa_ref((struct ifaddr *)dep[0]); ++ IN6_IFADDR_RUNLOCK(); + return dep[0]; +- if (dep[1]) ++ } ++ if (dep[1]) { ++ ifa_ref((struct ifaddr *)dep[1]); ++ IN6_IFADDR_RUNLOCK(); + return dep[1]; ++ } + ++ IN6_IFADDR_RUNLOCK(); + return NULL; + } + +Index: sys/netinet6/ip6_input.c +=================================================================== +--- sys/netinet6/ip6_input.c.orig ++++ sys/netinet6/ip6_input.c +@@ -879,19 +879,23 @@ passin: + * as our interface address (e.g. multicast addresses, addresses + * within FAITH prefixes and such). + */ +- if (deliverifp && !ip6_getdstifaddr(m)) { ++ if (deliverifp) { + struct in6_ifaddr *ia6; + +- ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); +- if (ia6) { +- if (!ip6_setdstifaddr(m, ia6)) { +- /* +- * XXX maybe we should drop the packet here, +- * as we could not provide enough information +- * to the upper layers. +- */ ++ if ((ia6 = ip6_getdstifaddr(m)) != NULL) { ++ ifa_free(&ia6->ia_ifa); ++ } else { ++ ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); ++ if (ia6) { ++ if (!ip6_setdstifaddr(m, ia6)) { ++ /* ++ * XXX maybe we should drop the packet here, ++ * as we could not provide enough information ++ * to the upper layers. ++ */ ++ } ++ ifa_free(&ia6->ia_ifa); + } +- ifa_free(&ia6->ia_ifa); + } + } + +Index: sys/netinet/tcp_input.c +=================================================================== +--- sys/netinet/tcp_input.c.orig ++++ sys/netinet/tcp_input.c +@@ -512,6 +512,8 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) + (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); + return IPPROTO_DONE; + } ++ if (ia6) ++ ifa_free(&ia6->ia_ifa); + + tcp_input(m, *offp); + return IPPROTO_DONE; +@@ -1240,7 +1242,8 @@ relocked: + rstreason = BANDLIM_RST_OPENPORT; + goto dropwithreset; + } +- ifa_free(&ia6->ia_ifa); ++ if (ia6) ++ ifa_free(&ia6->ia_ifa); + } + #endif /* INET6 */ + /* diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-sysctluint.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-sysctluint.patch new file mode 100644 index 000000000000..751a77c843bb --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.0-sysctluint.patch @@ -0,0 +1,13 @@ +u_int is defined in sys/types.h +makes header usable alone. + +--- sys/sys/sysctl.h.old 2012-05-25 11:08:53.000000000 -0400 ++++ sys/sys/sysctl.h 2012-05-25 11:09:16.000000000 -0400 +@@ -788,6 +788,7 @@ + struct sysctl_req *); + #else /* !_KERNEL */ + #include ++#include /* for u_int */ + + __BEGIN_DECLS + int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ciss.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ciss.patch new file mode 100644 index 000000000000..697984b92e74 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ciss.patch @@ -0,0 +1,65 @@ +Index: sys/dev/ciss/ciss.c +=================================================================== +--- sys/dev/ciss/ciss.c (revision 264510) ++++ sys/dev/ciss/ciss.c (revision 264511) +@@ -180,8 +180,6 @@ + static void ciss_cam_poll(struct cam_sim *sim); + static void ciss_cam_complete(struct ciss_request *cr); + static void ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio); +-static struct cam_periph *ciss_find_periph(struct ciss_softc *sc, +- int bus, int target); + static int ciss_name_device(struct ciss_softc *sc, int bus, int target); + + /* periodic status monitoring */ +@@ -3398,27 +3396,6 @@ + + + /******************************************************************************** +- * Find a peripheral attached at (target) +- */ +-static struct cam_periph * +-ciss_find_periph(struct ciss_softc *sc, int bus, int target) +-{ +- struct cam_periph *periph; +- struct cam_path *path; +- int status; +- +- status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), +- target, 0); +- if (status == CAM_REQ_CMP) { +- periph = cam_periph_find(path, NULL); +- xpt_free_path(path); +- } else { +- periph = NULL; +- } +- return(periph); +-} +- +-/******************************************************************************** + * Name the device at (target) + * + * XXX is this strictly correct? +@@ -3427,12 +3404,22 @@ + ciss_name_device(struct ciss_softc *sc, int bus, int target) + { + struct cam_periph *periph; ++ struct cam_path *path; ++ int status; + + if (CISS_IS_PHYSICAL(bus)) + return (0); +- if ((periph = ciss_find_periph(sc, bus, target)) != NULL) { ++ ++ status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), ++ target, 0); ++ ++ if (status == CAM_REQ_CMP) { ++ mtx_lock(&sc->ciss_mtx); ++ periph = cam_periph_find(path, NULL); + sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", + periph->periph_name, periph->unit_number); ++ mtx_unlock(&sc->ciss_mtx); ++ xpt_free_path(path); + return(0); + } + sc->ciss_logical[bus][target].cl_name[0] = 0; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3077.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3077.patch new file mode 100644 index 000000000000..23f68ed9c3db --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3077.patch @@ -0,0 +1,26 @@ +Index: sys/netinet/in_mcast.c +=================================================================== +--- sys/netinet/in_mcast.c (revision 254252) ++++ sys/netinet/in_mcast.c (working copy) +@@ -1648,6 +1648,8 @@ + * has asked for, but we always tell userland how big the + * buffer really needs to be. + */ ++ if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) ++ msfr.msfr_nsrcs = in_mcast_maxsocksrc; + tss = NULL; + if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { + tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, +Index: sys/netinet6/in6_mcast.c +=================================================================== +--- sys/netinet6/in6_mcast.c (revision 254252) ++++ sys/netinet6/in6_mcast.c (working copy) +@@ -1625,6 +1625,8 @@ + * has asked for, but we always tell userland how big the + * buffer really needs to be. + */ ++ if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) ++ msfr.msfr_nsrcs = in6_mcast_maxsocksrc; + tss = NULL; + if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { + tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3266.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3266.patch new file mode 100644 index 000000000000..0d1a89419e5f --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-3266.patch @@ -0,0 +1,13 @@ +Index: sys/fs/nfsserver/nfs_nfsdport.c +=================================================================== +--- sys/fs/nfsserver/nfs_nfsdport.c (revision 249651) ++++ sys/fs/nfsserver/nfs_nfsdport.c (working copy) +@@ -1568,6 +1568,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdg + nd->nd_repstat = NFSERR_BAD_COOKIE; + #endif + } ++ if (!nd->nd_repstat && vp->v_type != VDIR) ++ nd->nd_repstat = NFSERR_NOTDIR; + if (nd->nd_repstat == 0 && cnt == 0) { + if (nd->nd_flag & ND_NFSV2) + /* NFSv2 does not have NFSERR_TOOSMALL */ diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5209.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5209.patch new file mode 100644 index 000000000000..e6710e3bcb8b --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5209.patch @@ -0,0 +1,19 @@ +Index: sys/netinet/sctp_output.c +=================================================================== +--- sys/netinet/sctp_output.c (revision 254337) ++++ sys/netinet/sctp_output.c (revision 254338) +@@ -5406,6 +5406,14 @@ + } + SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + ++ /* ++ * We might not overwrite the identification[] completely and on ++ * some platforms time_entered will contain some padding. Therefore ++ * zero out the cookie to avoid putting uninitialized memory on the ++ * wire. ++ */ ++ memset(&stc, 0, sizeof(struct sctp_state_cookie)); ++ + /* the time I built cookie */ + (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); + diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5691.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5691.patch new file mode 100644 index 000000000000..9aef1503f770 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5691.patch @@ -0,0 +1,89 @@ +Index: sys/net/if.c +=================================================================== +--- sys/net/if.c (revision 254941) ++++ sys/net/if.c (working copy) +@@ -2553,11 +2553,23 @@ + CURVNET_RESTORE(); + return (EOPNOTSUPP); + } ++ ++ /* ++ * Pass the request on to the socket control method, and if the ++ * latter returns EOPNOTSUPP, directly to the interface. ++ * ++ * Make an exception for the legacy SIOCSIF* requests. Drivers ++ * trust SIOCSIFADDR et al to come from an already privileged ++ * layer, and do not perform any credentials checks or input ++ * validation. ++ */ + #ifndef COMPAT_43 + error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd, + data, + ifp, td)); +- if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL) ++ if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL && ++ cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR && ++ cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK) + error = (*ifp->if_ioctl)(ifp, cmd, data); + #else + { +@@ -2601,7 +2613,9 @@ + data, + ifp, td)); + if (error == EOPNOTSUPP && ifp != NULL && +- ifp->if_ioctl != NULL) ++ ifp->if_ioctl != NULL && ++ cmd != SIOCSIFADDR && cmd != SIOCSIFBRDADDR && ++ cmd != SIOCSIFDSTADDR && cmd != SIOCSIFNETMASK) + error = (*ifp->if_ioctl)(ifp, cmd, data); + switch (ocmd) { + +Index: sys/netinet6/in6.c +=================================================================== +--- sys/netinet6/in6.c (revision 254941) ++++ sys/netinet6/in6.c (working copy) +@@ -431,6 +431,18 @@ + case SIOCGIFSTAT_ICMP6: + sa6 = &ifr->ifr_addr; + break; ++ case SIOCSIFADDR: ++ case SIOCSIFBRDADDR: ++ case SIOCSIFDSTADDR: ++ case SIOCSIFNETMASK: ++ /* ++ * Although we should pass any non-INET6 ioctl requests ++ * down to driver, we filter some legacy INET requests. ++ * Drivers trust SIOCSIFADDR et al to come from an already ++ * privileged layer, and do not perform any credentials ++ * checks or input validation. ++ */ ++ return (EINVAL); + default: + sa6 = NULL; + break; +Index: sys/netnatm/natm.c +=================================================================== +--- sys/netnatm/natm.c (revision 254941) ++++ sys/netnatm/natm.c (working copy) +@@ -339,6 +339,21 @@ + npcb = (struct natmpcb *)so->so_pcb; + KASSERT(npcb != NULL, ("natm_usr_control: npcb == NULL")); + ++ switch (cmd) { ++ case SIOCSIFADDR: ++ case SIOCSIFBRDADDR: ++ case SIOCSIFDSTADDR: ++ case SIOCSIFNETMASK: ++ /* ++ * Although we should pass any non-ATM ioctl requests ++ * down to driver, we filter some legacy INET requests. ++ * Drivers trust SIOCSIFADDR et al to come from an already ++ * privileged layer, and do not perform any credentials ++ * checks or input validation. ++ */ ++ return (EINVAL); ++ } ++ + if (ifp == NULL || ifp->if_ioctl == NULL) + return (EOPNOTSUPP); + return ((*ifp->if_ioctl)(ifp, cmd, arg)); diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5710.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5710.patch new file mode 100644 index 000000000000..83f30e84fe9e --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2013-5710.patch @@ -0,0 +1,28 @@ +Index: sys/fs/nullfs/null_vnops.c +=================================================================== +--- sys/fs/nullfs/null_vnops.c (revision 254941) ++++ sys/fs/nullfs/null_vnops.c (working copy) +@@ -858,6 +858,15 @@ + return (error); + } + ++static int ++null_link(struct vop_link_args *ap) ++{ ++ ++ if (ap->a_tdvp->v_mount != ap->a_vp->v_mount) ++ return (EXDEV); ++ return (null_bypass((struct vop_generic_args *)ap)); ++} ++ + /* + * Global vfs data structures + */ +@@ -871,6 +880,7 @@ + .vop_getwritemount = null_getwritemount, + .vop_inactive = null_inactive, + .vop_islocked = vop_stdislocked, ++ .vop_link = null_link, + .vop_lock1 = null_lock, + .vop_lookup = null_lookup, + .vop_open = null_open, diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2014-1453.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2014-1453.patch new file mode 100644 index 000000000000..fe9e97efd298 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-cve-2014-1453.patch @@ -0,0 +1,70 @@ +Index: sys/fs/nfsserver/nfs_nfsdserv.c +=================================================================== +--- sys/fs/nfsserver/nfs_nfsdserv.c (revision 264251) ++++ sys/fs/nfsserver/nfs_nfsdserv.c (working copy) +@@ -1457,10 +1457,23 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgr + nfsvno_relpathbuf(&fromnd); + goto out; + } ++ /* ++ * Unlock dp in this code section, so it is unlocked before ++ * tdp gets locked. This avoids a potential LOR if tdp is the ++ * parent directory of dp. ++ */ + if (nd->nd_flag & ND_NFSV4) { + tdp = todp; + tnes = *toexp; +- tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0); ++ if (dp != tdp) { ++ NFSVOPUNLOCK(dp, 0); ++ tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, ++ p, 0); /* Might lock tdp. */ ++ } else { ++ tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, ++ p, 1); ++ NFSVOPUNLOCK(dp, 0); ++ } + } else { + tfh.nfsrvfh_len = 0; + error = nfsrv_mtofh(nd, &tfh); +@@ -1481,10 +1494,12 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgr + tnes = *exp; + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, + p, 1); ++ NFSVOPUNLOCK(dp, 0); + } else { ++ NFSVOPUNLOCK(dp, 0); + nd->nd_cred->cr_uid = nd->nd_saveduid; + nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, +- 0, p); ++ 0, p); /* Locks tdp. */ + if (tdp) { + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, + nd->nd_cred, p, 1); +@@ -1499,7 +1514,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgr + if (error) { + if (tdp) + vrele(tdp); +- vput(dp); ++ vrele(dp); + nfsvno_relpathbuf(&fromnd); + nfsvno_relpathbuf(&tond); + goto out; +@@ -1514,7 +1529,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgr + } + if (tdp) + vrele(tdp); +- vput(dp); ++ vrele(dp); + nfsvno_relpathbuf(&fromnd); + nfsvno_relpathbuf(&tond); + goto out; +@@ -1523,7 +1538,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgr + /* + * Done parsing, now down to business. + */ +- nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 1, exp, p, &fdirp); ++ nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 0, exp, p, &fdirp); + if (nd->nd_repstat) { + if (nd->nd_flag & ND_NFSV3) { + nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-exec.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-exec.patch new file mode 100644 index 000000000000..c36bed59b39e --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-exec.patch @@ -0,0 +1,66 @@ +Index: sys/kern/kern_exec.c +=================================================================== +--- sys/kern/kern_exec.c (revision 266979) ++++ sys/kern/kern_exec.c (working copy) +@@ -280,6 +280,7 @@ kern_execve(td, args, mac_p) + struct mac *mac_p; + { + struct proc *p = td->td_proc; ++ struct vmspace *oldvmspace; + int error; + + AUDIT_ARG_ARGV(args->begin_argv, args->argc, +@@ -296,6 +297,8 @@ kern_execve(td, args, mac_p) + PROC_UNLOCK(p); + } + ++ KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); ++ oldvmspace = td->td_proc->p_vmspace; + error = do_execve(td, args, mac_p); + + if (p->p_flag & P_HADTHREADS) { +@@ -310,6 +313,12 @@ kern_execve(td, args, mac_p) + thread_single_end(); + PROC_UNLOCK(p); + } ++ if ((td->td_pflags & TDP_EXECVMSPC) != 0) { ++ KASSERT(td->td_proc->p_vmspace != oldvmspace, ++ ("oldvmspace still used")); ++ vmspace_free(oldvmspace); ++ td->td_pflags &= ~TDP_EXECVMSPC; ++ } + + return (error); + } +Index: sys/sys/proc.h +=================================================================== +--- sys/sys/proc.h (revision 266979) ++++ sys/sys/proc.h (working copy) +@@ -968,4 +968,5 @@ curthread_pflags_restore(int save) + + #endif /* _KERNEL */ + ++#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ + #endif /* !_SYS_PROC_H_ */ +Index: sys/vm/vm_map.c +=================================================================== +--- sys/vm/vm_map.c (revision 266979) ++++ sys/vm/vm_map.c (working copy) +@@ -3631,6 +3631,8 @@ vmspace_exec(struct proc *p, vm_offset_t minuser, + struct vmspace *oldvmspace = p->p_vmspace; + struct vmspace *newvmspace; + ++ KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, ++ ("vmspace_exec recursed")); + newvmspace = vmspace_alloc(minuser, maxuser); + if (newvmspace == NULL) + return (ENOMEM); +@@ -3647,7 +3649,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser, + PROC_VMSPACE_UNLOCK(p); + if (p == curthread->td_proc) + pmap_activate(curthread); +- vmspace_free(oldvmspace); ++ curthread->td_pflags |= TDP_EXECVMSPC; + return (0); + } + diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-gentoo.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-gentoo.patch new file mode 100644 index 000000000000..b02d8b68870c --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-gentoo.patch @@ -0,0 +1,21 @@ +diff -Nur sys.orig/conf/kern.mk sys/conf/kern.mk +--- sys.orig/conf/kern.mk 2012-07-12 13:26:37.000000000 +0900 ++++ sys/conf/kern.mk 2012-07-16 02:32:19.000000000 +0900 +@@ -5,7 +5,7 @@ + # + CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ +- -Wundef -Wno-pointer-sign -fformat-extensions \ ++ -Wundef -Wno-pointer-sign \ + -Wmissing-include-dirs -fdiagnostics-show-option \ + ${CWARNEXTRA} + # +@@ -52,7 +52,7 @@ + # + .if ${MACHINE_CPUARCH} == "i386" + .if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" +-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 ++CFLAGS+= -mpreferred-stack-boundary=2 + .else + CFLAGS+= -mno-aes -mno-avx + .endif diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ktrace.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ktrace.patch new file mode 100644 index 000000000000..0fb6df7600ef --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-ktrace.patch @@ -0,0 +1,12 @@ +Index: sys/kern/kern_ktrace.c +=================================================================== +--- sys/kern/kern_ktrace.c (revision 266771) ++++ sys/kern/kern_ktrace.c (working copy) +@@ -119,6 +119,7 @@ static int data_lengths[] = { + 0, /* KTR_SYSCTL */ + sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ + 0, /* KTR_PROCDTOR */ ++ 0, /* unused */ + sizeof(struct ktr_fault), /* KTR_FAULT */ + sizeof(struct ktr_faultend), /* KTR_FAULTEND */ + }; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap-2014.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap-2014.patch new file mode 100644 index 000000000000..fd4040a88166 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap-2014.patch @@ -0,0 +1,20 @@ +Index: sys/vm/vm_map.c +=================================================================== +--- sys/vm/vm_map.c (revision 259950) ++++ sys/vm/vm_map.c (revision 259951) +@@ -1207,6 +1207,7 @@ charged: + } + else if ((prev_entry != &map->header) && + (prev_entry->eflags == protoeflags) && ++ (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 && + (prev_entry->end == start) && + (prev_entry->wired_count == 0) && + (prev_entry->cred == cred || +@@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm + * NOTE: We explicitly allow bi-directional stacks. + */ + orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); +- cow &= ~orient; + KASSERT(orient != 0, ("No stack grow direction")); + + if (addrbos < vm_map_min(map) || diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch new file mode 100644 index 000000000000..ef2d0a78206b --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch @@ -0,0 +1,20 @@ +http://www.freebsd.org/security/advisories/FreeBSD-SA-13:06.mmap.asc +https://bugs.gentoo.org/show_bug.cgi?id=473688 + +Index: sys/vm/vm_map.c +=================================================================== +--- sys/vm/vm_map.c (revision 251636) ++++ sys/vm/vm_map.c (working copy) +@@ -3761,6 +3761,12 @@ RetryLookup:; + vm_map_unlock_read(map); + return (KERN_PROTECTION_FAILURE); + } ++ if ((fault_typea & VM_PROT_COPY) != 0 && ++ (entry->max_protection & VM_PROT_WRITE) == 0 && ++ (entry->eflags & MAP_ENTRY_COW) == 0) { ++ vm_map_unlock_read(map); ++ return (KERN_PROTECTION_FAILURE); ++ } + + /* + * If this page is not pageable, we have to get it for all possible diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-nfsserver.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-nfsserver.patch new file mode 100644 index 000000000000..767588fc86f6 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-nfsserver.patch @@ -0,0 +1,16 @@ +http://www.freebsd.org/security/advisories/FreeBSD-SA-13:08.nfsserver.asc +https://bugs.gentoo.org/show_bug.cgi?id=478314 + +Index: sys/kern/vfs_export.c +=================================================================== +--- sys/kern/vfs_export.c (revision 253367) ++++ sys/kern/vfs_export.c (working copy) +@@ -208,7 +208,7 @@ + np->netc_anon = crget(); + np->netc_anon->cr_uid = argp->ex_anon.cr_uid; + crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, +- np->netc_anon->cr_groups); ++ argp->ex_anon.cr_groups); + np->netc_anon->cr_prison = &prison0; + prison_hold(np->netc_anon->cr_prison); + np->netc_numsecflavors = argp->ex_numsecflavors; diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-random.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-random.patch new file mode 100644 index 000000000000..bb3caba00137 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-random.patch @@ -0,0 +1,27 @@ +Index: sys/dev/random/probe.c +=================================================================== +--- sys/dev/random/probe.c (revision 260523) ++++ sys/dev/random/probe.c (working copy) +@@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); + + #include + #include ++#include ++#include + #include + #include + #include +@@ -57,7 +59,12 @@ random_ident_hardware(struct random_systat *systat + /* Then go looking for hardware */ + #if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) + if (via_feature_rng & VIA_HAS_RNG) { +- *systat = random_nehemiah; ++ int enable; ++ ++ enable = 0; ++ TUNABLE_INT_FETCH("hw.nehemiah_rng_enable", &enable); ++ if (enable) ++ *systat = random_nehemiah; + } + #endif + } diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch new file mode 100644 index 000000000000..2f82a5f98a58 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-tcp.patch @@ -0,0 +1,32 @@ +Index: sys/netinet/tcp_reass.c +=================================================================== +--- sys/netinet/tcp_reass.c (revision 264836) ++++ sys/netinet/tcp_reass.c (working copy) +@@ -211,7 +211,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int + * Investigate why and re-evaluate the below limit after the behaviour + * is understood. + */ +- if (th->th_seq != tp->rcv_nxt && ++ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && + tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + V_tcp_reass_overflows++; + TCPSTAT_INC(tcps_rcvmemdrop); +@@ -234,7 +234,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int + */ + te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); + if (te == NULL) { +- if (th->th_seq != tp->rcv_nxt) { ++ if (th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) { + TCPSTAT_INC(tcps_rcvmemdrop); + m_freem(m); + *tlenp = 0; +@@ -282,7 +282,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int + TCPSTAT_INC(tcps_rcvduppack); + TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp); + m_freem(m); +- uma_zfree(V_tcp_reass_zone, te); ++ if (te != &tqs) ++ uma_zfree(V_tcp_reass_zone, te); + tp->t_segqlen--; + /* + * Try to present any queued data diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.2-gentoo-gcc.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.2-gentoo-gcc.patch new file mode 100644 index 000000000000..9076fd2b595d --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.2-gentoo-gcc.patch @@ -0,0 +1,13 @@ +diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh +index e504f75..7aa63df 100644 +--- a/sys/conf/newvers.sh ++++ b/sys/conf/newvers.sh +@@ -86,7 +86,7 @@ fi + touch version + v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` + i=`${MAKE:-make} -V KERN_IDENT` +-compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') ++compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version' | tail -n 1) + + for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/svnversion" ] ; then diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-cve-2012-0217.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-cve-2012-0217.patch new file mode 100644 index 000000000000..0bf1b611a091 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-cve-2012-0217.patch @@ -0,0 +1,26 @@ +Index: sys/amd64/amd64/trap.c +=================================================================== +--- sys/amd64/amd64/trap.c.orig ++++ sys/amd64/amd64/trap.c (working copy) +@@ -972,4 +972,21 @@ + syscallname(td->td_proc, sa.code))); + + syscallret(td, error, &sa); ++ ++ /* ++ * If the user-supplied value of %rip is not a canonical ++ * address, then some CPUs will trigger a ring 0 #GP during ++ * the sysret instruction. However, the fault handler would ++ * execute with the user's %gs and %rsp in ring 0 which would ++ * not be safe. Instead, preemptively kill the thread with a ++ * SIGBUS. ++ */ ++ if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) { ++ ksiginfo_init_trap(&ksi); ++ ksi.ksi_signo = SIGBUS; ++ ksi.ksi_code = BUS_OBJERR; ++ ksi.ksi_trapno = T_PROTFLT; ++ ksi.ksi_addr = (void *)td->td_frame->tf_rip; ++ trapsignal(td, &ksi); ++ } + } diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-10.1-r6.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-10.1-r6.ebuild new file mode 100644 index 000000000000..709554c6a222 --- /dev/null +++ b/sys-freebsd/freebsd-sources/freebsd-sources-10.1-r6.ebuild @@ -0,0 +1,166 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit bsdmk freebsd flag-o-matic toolchain-funcs + +DESCRIPTION="FreeBSD kernel sources" +SLOT="0" + +IUSE="+build-kernel debug dtrace zfs" + +# Security Advisory and Errata patches. +UPSTREAM_PATCHES=( "SA-15:02/sctp.patch" + "SA-15:03/sctp.patch" + "SA-15:04/igmp.patch" + "SA-15:04/igmp-errata.patch" + "SA-15:09/ipv6.patch" + "SA-15:13/tcp.patch" + "SA-15:15/tcp-9.3-10.1.patch" + "EN-15:01/vt.patch" + "EN-15:05/ufs.patch" + "EN-15:07/zfs.patch" ) + +if [[ ${PV} != *9999* ]]; then + KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" + SRC_URI="${SRC_URI} + $(freebsd_upstream_patches)" +fi + +EXTRACTONLY=" + sys/ + contrib/bmake/ + usr.bin/bmake/ +" +use zfs && EXTRACTONLY+="cddl/" + +RDEPEND="dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 ) + =sys-freebsd/freebsd-mk-defs-${RV}* + !sys-freebsd/virtio-kmod + !sys-fs/fuse4bsd + !> "${conf}" + use dtrace || echo 'nomakeoptions WITH_CTF' >> "${conf}" + + # Only used with USE=build-kernel, let the kernel build with its own flags, its safer. + unset LDFLAGS CFLAGS CXXFLAGS ASFLAGS KERNEL +} + +src_configure() { + if use build-kernel ; then + tc-export CC + cd "${S}/$(tc-arch-kernel)/conf" || die + config ${KERN_BUILD} || die + fi +} + +src_compile() { + if use build-kernel ; then + if has_version "=sys-freebsd/freebsd-cddl-9.2_beta1' ; then + ewarn "GENERIC config require sys-freebsd/freebsd-cddl. Please emerge it." + fi +} diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-8.2-r2.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-8.2-r2.ebuild new file mode 100644 index 000000000000..d82d9f39fecc --- /dev/null +++ b/sys-freebsd/freebsd-sources/freebsd-sources-8.2-r2.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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-8.0" +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" + + # __FreeBSD_cc_version comes from FreeBSD's gcc. + # on 8.2-RELEASE it's 800001. + sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=800001:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version" + + # Remove -Werror + sed -e "s:-Werror:-Wno-error:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die + + epatch "${FILESDIR}/${PN}-8.0-gentoo.patch" + epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" + sed -e 's/elf64-sparc/elf64-sparc-freebsd/g' -i "${S}/conf/ldscript.sparc64" || die + epatch "${FILESDIR}/${PN}-6.1-ntfs.patch" + epatch "${FILESDIR}/${PN}-7.2-debug-O2.patch" + epatch "${FILESDIR}/${PN}-7.1-types.h-fix.patch" + epatch "${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch" + epatch "${FILESDIR}/${PN}-7.1-includes.patch" + # http://security.FreeBSD.org/patches/SA-11:05/unix2.patch + epatch "${FILESDIR}"/${P}-unix2.patch + + # By adding -DGENTOO_LIVECD to CFLAGS activate this stub + # vop_whiteout to tmpfs, so it can be used as an overlay + # unionfs filesystem over the cd9660 readonly filesystem. + epatch "${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch" + + # See http://sourceware.org/bugzilla/show_bug.cgi?id=5391 + # ld doesn't provide symbols constructed as the __start_set_(s) ones + # are on FreeBSD modules. + # This patch adds code to generate a list of these and adds them + # as undefined references to ld's commandline to get them. + # Without this kernel modules will not load. + epatch "${FILESDIR}/${PN}-7.1-binutils_link.patch" + + epatch "${FILESDIR}/${PN}-cve-2012-0217.patch" + epatch "${FILESDIR}/${PN}-9.0-ipv6refcount.patch" +} + +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 +} diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r3.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r3.ebuild new file mode 100644 index 000000000000..99cc5f4587a7 --- /dev/null +++ b/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r3.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +inherit bsdmk freebsd flag-o-matic + +DESCRIPTION="FreeBSD kernel sources" +SLOT="${RV}" +KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" + +IUSE="symlink" + +SRC_URI="mirror://gentoo/${SYS}.tar.bz2" + +RDEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*" +DEPEND="" + +RESTRICT="strip binchecks" + +S="${WORKDIR}/sys" + +PATCHES=( "${FILESDIR}/${PN}-9.0-disable-optimization.patch" + "${FILESDIR}/${PN}-9.1-gentoo.patch" + "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" + "${FILESDIR}/${PN}-6.1-ntfs.patch" + "${FILESDIR}/${PN}-7.1-types.h-fix.patch" + "${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch" + "${FILESDIR}/${PN}-7.1-includes.patch" + "${FILESDIR}/${PN}-9.0-sysctluint.patch" + "${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-3266.patch" + "${FILESDIR}/${PN}-9.1-mmap.patch" + "${FILESDIR}/${PN}-9.1-nfsserver.patch" ) + +src_unpack() { + freebsd_src_unpack + + # 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" + + # __FreeBSD_cc_version comes from FreeBSD's gcc. + # on 9.0-RELEASE it's 900001. + sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=900001:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version" + + # Remove -Werror + sed -e "s:-Werror:-Wno-error:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die +} + +src_compile() { + einfo "Nothing to compile.." +} + +src_install() { + insinto "/usr/src/sys-${RV}" + doins -r "${S}/"* +} + +pkg_postinst() { + if [[ ! -L "${ROOT}/usr/src/sys" ]]; then + einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${RV}..." + ln -sf "sys-${RV}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys symlink." + elif use symlink; then + einfo "Updating /usr/src/sys symlink to sys-${RV}..." + rm "${ROOT}/usr/src/sys" || \ + eerror "Couldn't remove previous symlinks, please fix manually." + ln -sf "sys-${RV}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys 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 +} diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r9.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r9.ebuild new file mode 100644 index 000000000000..1ad109ea2428 --- /dev/null +++ b/sys-freebsd/freebsd-sources/freebsd-sources-9.1-r9.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +inherit bsdmk freebsd flag-o-matic + +DESCRIPTION="FreeBSD kernel sources" +SLOT="${RV}" +KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" + +IUSE="symlink" + +SRC_URI="mirror://gentoo/${SYS}.tar.bz2 + http://dev.gentoo.org/~naota/patch/${P}-en-13-03.patch" + +RDEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*" +DEPEND="" + +RESTRICT="strip binchecks" + +S="${WORKDIR}/sys" + +PATCHES=( "${FILESDIR}/${PN}-9.0-disable-optimization.patch" + "${FILESDIR}/${PN}-9.1-gentoo.patch" + "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" + "${FILESDIR}/${PN}-6.1-ntfs.patch" + "${FILESDIR}/${PN}-7.1-types.h-fix.patch" + "${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch" + "${FILESDIR}/${PN}-7.1-includes.patch" + "${FILESDIR}/${PN}-9.0-sysctluint.patch" + "${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-3266.patch" + "${FILESDIR}/${PN}-9.1-mmap.patch" + "${FILESDIR}/${PN}-9.1-nfsserver.patch" + "${DISTDIR}/${PN}-9.1-en-13-03.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-3077.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-5209.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-5691.patch" + "${FILESDIR}/${PN}-9.1-cve-2013-5710.patch" + "${FILESDIR}/${PN}-9.1-cve-2014-1453.patch" + "${FILESDIR}/${PN}-9.1-random.patch" + "${FILESDIR}/${PN}-9.1-mmap-2014.patch" + "${FILESDIR}/${PN}-9.1-tcp.patch" + "${FILESDIR}/${PN}-9.1-ciss.patch" + "${FILESDIR}/${PN}-9.1-exec.patch" + "${FILESDIR}/${PN}-9.1-ktrace.patch" ) + +src_unpack() { + freebsd_src_unpack + + # 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" + + # __FreeBSD_cc_version comes from FreeBSD's gcc. + # on 9.0-RELEASE it's 900001. + sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=900001:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version" + + # Remove -Werror + sed -e "s:-Werror:-Wno-error:g" \ + -i "${S}/conf/kern.pre.mk" \ + -i "${S}/conf/kmod.mk" || die +} + +src_compile() { + einfo "Nothing to compile.." +} + +src_install() { + insinto "/usr/src/sys-${RV}" + doins -r "${S}/"* +} + +pkg_postinst() { + if [[ ! -L "${ROOT}/usr/src/sys" ]]; then + einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${RV}..." + ln -sf "sys-${RV}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys symlink." + elif use symlink; then + einfo "Updating /usr/src/sys symlink to sys-${RV}..." + rm "${ROOT}/usr/src/sys" || \ + eerror "Couldn't remove previous symlinks, please fix manually." + ln -sf "sys-${RV}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys 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 +} diff --git a/sys-freebsd/freebsd-sources/metadata.xml b/sys-freebsd/freebsd-sources/metadata.xml new file mode 100644 index 000000000000..dfe9547a448b --- /dev/null +++ b/sys-freebsd/freebsd-sources/metadata.xml @@ -0,0 +1,10 @@ + + + +bsd + + Build and install a kernel (recommended). + Enable DTrace support. + Enable ZFS support. + + -- cgit v1.2.3-65-gdbad