110-netdev_random_core.patch 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. --- a/Documentation/Configure.help
  2. +++ b/Documentation/Configure.help
  3. @@ -10687,6 +10687,20 @@ CONFIG_TUN
  4. If you don't know what to use this for, you don't need it.
  5. +Allow Net Devices to contribute to /dev/random
  6. +CONFIG_NET_RANDOM
  7. + If you say Y here, network device interrupts will contribute to the
  8. + kernel entropy pool. Normally, block devices and some other devices
  9. + feed the pool. Some systems, such as those that are headless or diskless,
  10. + need additional entropy sources. Some people, however, feel that network
  11. + devices should not contribute to /dev/random because an external attacker
  12. + could observe incoming packets in an attempt to learn the entropy pool's
  13. + state. If you say N, no network device will contribute entropy.
  14. +
  15. + If you believe there is a chance of your network packets being observed
  16. + and you doubt the security of the entropy pool's one-way hash, do not
  17. + enable this. If unsure, say N.
  18. +
  19. Ethertap network tap (OBSOLETE)
  20. CONFIG_ETHERTAP
  21. If you say Y here (and have said Y to "Kernel/User network link
  22. --- a/drivers/net/Config.in
  23. +++ b/drivers/net/Config.in
  24. @@ -8,6 +8,7 @@ tristate 'Dummy net driver support' CONF
  25. tristate 'Bonding driver support' CONFIG_BONDING
  26. tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
  27. tristate 'Universal TUN/TAP device driver support' CONFIG_TUN
  28. +bool 'Allow Net Devices to contribute to /dev/random' CONFIG_NET_RANDOM
  29. if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  30. tristate 'Ethertap network tap (OBSOLETE)' CONFIG_ETHERTAP
  31. fi
  32. --- a/include/asm-alpha/signal.h
  33. +++ b/include/asm-alpha/signal.h
  34. @@ -121,8 +121,15 @@ typedef unsigned long sigset_t;
  35. #define SA_PROBE SA_ONESHOT
  36. #define SA_SAMPLE_RANDOM SA_RESTART
  37. #define SA_SHIRQ 0x40000000
  38. +
  39. +#ifdef CONFIG_NET_RANDOM
  40. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  41. +#else
  42. +#define SA_NET_RANDOM 0
  43. #endif
  44. +#endif /* __KERNEL__ */
  45. +
  46. #define SIG_BLOCK 1 /* for blocking signals */
  47. #define SIG_UNBLOCK 2 /* for unblocking signals */
  48. #define SIG_SETMASK 3 /* for setting the signal mask */
  49. --- a/include/asm-arm/signal.h
  50. +++ b/include/asm-arm/signal.h
  51. @@ -125,8 +125,15 @@ typedef unsigned long sigset_t;
  52. #define SA_PROBE 0x80000000
  53. #define SA_SAMPLE_RANDOM 0x10000000
  54. #define SA_SHIRQ 0x04000000
  55. +
  56. +#ifdef CONFIG_NET_RANDOM
  57. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  58. +#else
  59. +#define SA_NET_RANDOM 0
  60. #endif
  61. +#endif /* __KERNEL__ */
  62. +
  63. #define SIG_BLOCK 0 /* for blocking signals */
  64. #define SIG_UNBLOCK 1 /* for unblocking signals */
  65. #define SIG_SETMASK 2 /* for setting the signal mask */
  66. --- a/include/asm-cris/signal.h
  67. +++ b/include/asm-cris/signal.h
  68. @@ -120,8 +120,15 @@ typedef unsigned long sigset_t;
  69. #define SA_PROBE SA_ONESHOT
  70. #define SA_SAMPLE_RANDOM SA_RESTART
  71. #define SA_SHIRQ 0x04000000
  72. +
  73. +#ifdef CONFIG_NET_RANDOM
  74. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  75. +#else
  76. +#define SA_NET_RANDOM 0
  77. #endif
  78. +#endif /* __KERNEL__ */
  79. +
  80. #define SIG_BLOCK 0 /* for blocking signals */
  81. #define SIG_UNBLOCK 1 /* for unblocking signals */
  82. #define SIG_SETMASK 2 /* for setting the signal mask */
  83. --- a/include/asm-i386/signal.h
  84. +++ b/include/asm-i386/signal.h
  85. @@ -119,8 +119,15 @@ typedef unsigned long sigset_t;
  86. #define SA_PROBE SA_ONESHOT
  87. #define SA_SAMPLE_RANDOM SA_RESTART
  88. #define SA_SHIRQ 0x04000000
  89. +
  90. +#ifdef CONFIG_NET_RANDOM
  91. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  92. +#else
  93. +#define SA_NET_RANDOM 0
  94. #endif
  95. +#endif /* __KERNEL__ */
  96. +
  97. #define SIG_BLOCK 0 /* for blocking signals */
  98. #define SIG_UNBLOCK 1 /* for unblocking signals */
  99. #define SIG_SETMASK 2 /* for setting the signal mask */
  100. --- a/include/asm-ia64/signal.h
  101. +++ b/include/asm-ia64/signal.h
  102. @@ -117,6 +117,12 @@
  103. #define SA_SHIRQ 0x04000000
  104. #define SA_PERCPU_IRQ 0x02000000
  105. +#ifdef CONFIG_NET_RANDOM
  106. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  107. +#else
  108. +#define SA_NET_RANDOM 0
  109. +#endif
  110. +
  111. #endif /* __KERNEL__ */
  112. #define SIG_BLOCK 0 /* for blocking signals */
  113. --- a/include/asm-m68k/signal.h
  114. +++ b/include/asm-m68k/signal.h
  115. @@ -116,8 +116,15 @@ typedef unsigned long sigset_t;
  116. #define SA_PROBE SA_ONESHOT
  117. #define SA_SAMPLE_RANDOM SA_RESTART
  118. #define SA_SHIRQ 0x04000000
  119. +
  120. +#ifdef CONFIG_NET_RANDOM
  121. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  122. +#else
  123. +#define SA_NET_RANDOM 0
  124. #endif
  125. +#endif /* __KERNEL__ */
  126. +
  127. #define SIG_BLOCK 0 /* for blocking signals */
  128. #define SIG_UNBLOCK 1 /* for unblocking signals */
  129. #define SIG_SETMASK 2 /* for setting the signal mask */
  130. --- a/include/asm-mips/signal.h
  131. +++ b/include/asm-mips/signal.h
  132. @@ -111,6 +111,12 @@ typedef unsigned long old_sigset_t; /*
  133. #define SA_SAMPLE_RANDOM SA_RESTART
  134. #define SA_SHIRQ 0x02000000
  135. +#ifdef CONFIG_NET_RANDOM
  136. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  137. +#else
  138. +#define SA_NET_RANDOM 0
  139. +#endif
  140. +
  141. #endif /* __KERNEL__ */
  142. #define SIG_BLOCK 1 /* for blocking signals */
  143. --- a/include/asm-mips64/signal.h
  144. +++ b/include/asm-mips64/signal.h
  145. @@ -119,6 +119,12 @@ typedef unsigned int old_sigset_t32;
  146. #define SA_SAMPLE_RANDOM SA_RESTART
  147. #define SA_SHIRQ 0x02000000
  148. +#ifdef CONFIG_NET_RANDOM
  149. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  150. +#else
  151. +#define SA_NET_RANDOM 0
  152. +#endif
  153. +
  154. #endif /* __KERNEL__ */
  155. #define SIG_BLOCK 1 /* for blocking signals */
  156. --- a/include/asm-parisc/signal.h
  157. +++ b/include/asm-parisc/signal.h
  158. @@ -100,6 +100,12 @@
  159. #define SA_SAMPLE_RANDOM SA_RESTART
  160. #define SA_SHIRQ 0x04000000
  161. +#ifdef CONFIG_NET_RANDOM
  162. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  163. +#else
  164. +#define SA_NET_RANDOM 0
  165. +#endif
  166. +
  167. #endif /* __KERNEL__ */
  168. #define SIG_BLOCK 0 /* for blocking signals */
  169. --- a/include/asm-ppc/signal.h
  170. +++ b/include/asm-ppc/signal.h
  171. @@ -111,6 +111,13 @@ typedef struct {
  172. #define SA_PROBE SA_ONESHOT
  173. #define SA_SAMPLE_RANDOM SA_RESTART
  174. #define SA_SHIRQ 0x04000000
  175. +
  176. +#ifdef CONFIG_NET_RANDOM
  177. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  178. +#else
  179. +#define SA_NET_RANDOM 0
  180. +#endif
  181. +
  182. #endif /* __KERNEL__ */
  183. #define SIG_BLOCK 0 /* for blocking signals */
  184. --- a/include/asm-s390/signal.h
  185. +++ b/include/asm-s390/signal.h
  186. @@ -129,8 +129,15 @@ typedef unsigned long sigset_t;
  187. #define SA_SHIRQ 0x04000000
  188. #define SA_DOPATHGROUP 0x00100000
  189. #define SA_FORCE 0x00200000
  190. +
  191. +#ifdef CONFIG_NET_RANDOM
  192. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  193. +#else
  194. +#define SA_NET_RANDOM 0
  195. #endif
  196. +#endif /* __KERNEL__ */
  197. +
  198. #define SIG_BLOCK 0 /* for blocking signals */
  199. #define SIG_UNBLOCK 1 /* for unblocking signals */
  200. #define SIG_SETMASK 2 /* for setting the signal mask */
  201. --- a/include/asm-s390x/signal.h
  202. +++ b/include/asm-s390x/signal.h
  203. @@ -129,8 +129,15 @@ typedef unsigned long sigset_t;
  204. #define SA_SHIRQ 0x04000000
  205. #define SA_DOPATHGROUP 0x00100000
  206. #define SA_FORCE 0x00200000
  207. +
  208. +#ifdef CONFIG_NET_RANDOM
  209. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  210. +#else
  211. +#define SA_NET_RANDOM 0
  212. #endif
  213. +#endif /* __KERNEL__ */
  214. +
  215. #define SIG_BLOCK 0 /* for blocking signals */
  216. #define SIG_UNBLOCK 1 /* for unblocking signals */
  217. #define SIG_SETMASK 2 /* for setting the signal mask */
  218. --- a/include/asm-sh/signal.h
  219. +++ b/include/asm-sh/signal.h
  220. @@ -107,8 +107,15 @@ typedef struct {
  221. #define SA_PROBE SA_ONESHOT
  222. #define SA_SAMPLE_RANDOM SA_RESTART
  223. #define SA_SHIRQ 0x04000000
  224. +
  225. +#ifdef CONFIG_NET_RANDOM
  226. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  227. +#else
  228. +#define SA_NET_RANDOM 0
  229. #endif
  230. +#endif /* __KERNEL__ */
  231. +
  232. #define SIG_BLOCK 0 /* for blocking signals */
  233. #define SIG_UNBLOCK 1 /* for unblocking signals */
  234. #define SIG_SETMASK 2 /* for setting the signal mask */
  235. --- a/include/asm-sparc/signal.h
  236. +++ b/include/asm-sparc/signal.h
  237. @@ -176,8 +176,15 @@ struct sigstack {
  238. #define SA_PROBE SA_ONESHOT
  239. #define SA_SAMPLE_RANDOM SA_RESTART
  240. #define SA_STATIC_ALLOC 0x80
  241. +
  242. +#ifdef CONFIG_NET_RANDOM
  243. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  244. +#else
  245. +#define SA_NET_RANDOM 0
  246. #endif
  247. +#endif /* __KERNEL__ */
  248. +
  249. /* Type of a signal handler. */
  250. #ifdef __KERNEL__
  251. typedef void (*__sighandler_t)(int, int, struct sigcontext *, char *);
  252. --- a/include/asm-sparc64/signal.h
  253. +++ b/include/asm-sparc64/signal.h
  254. @@ -192,8 +192,15 @@ struct sigstack {
  255. #define SA_PROBE SA_ONESHOT
  256. #define SA_SAMPLE_RANDOM SA_RESTART
  257. #define SA_STATIC_ALLOC 0x80
  258. +
  259. +#ifdef CONFIG_NET_RANDOM
  260. +#define SA_NET_RANDOM SA_SAMPLE_RANDOM
  261. +#else
  262. +#define SA_NET_RANDOM 0
  263. #endif
  264. +#endif /* __KERNEL__ */
  265. +
  266. /* Type of a signal handler. */
  267. #ifdef __KERNEL__
  268. typedef void (*__sighandler_t)(int, struct sigcontext *);