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