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