Gentoo Archives: gentoo-hardened

From: "Tóth Attila" <atoth@××××××××××.hu>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] hardened-sources-2.6.36-r8
Date: Thu, 13 Jan 2011 21:02:53
Message-Id: 2eb4c10ba24d0281867b9a01958d8433.squirrel@atoth.sote.hu
In Reply to: [gentoo-hardened] hardened-sources-2.6.36-r8 by "Tóth Attila"
1 What about this one?
2
3 --- af_irda.c 2011-01-13 20:41:26.000000000 +0100
4 +++ af_irda-dwokfur.c 2011-01-13 20:41:50.000000000 +0100
5 @@ -2286,7 +2286,7 @@
6
7 if (len < offset) {
8 err = -EINVAL;
9 - goto out;
10 + goto bed;
11 }
12
13 /* Ask lmp for the current discovery log */
14
15 It still complains:
16
17 net/irda/af_irda.c: In function ‘irda_getsockopt’:
18 net/irda/af_irda.c:2258:27: warning: ‘discoveries’ may be used
19 uninitialized in this function
20 net/irda/af_irda.c:2258:27: note: ‘discoveries’ was declared here
21
22 Regards:
23 Dw.
24 --
25 dr Tóth Attila, Radiológus, 06-20-825-8057
26 Attila Toth MD, Radiologist, +36-20-825-8057
27
28 2011.Január 13.(Cs) 20:38 időpontban "Tóth Attila" ezt írta:
29 > Compiling the recent hardened-sources results in the following error
30 > message, when irda is enabled:
31 >
32 > CC net/irda/af_irda.o
33 > net/irda/af_irda.c: In function ‘__irda_getsockopt’:
34 > net/irda/af_irda.c:2289:4: error: label ‘out’ used but not defined
35 >
36 > The changes causing it introduced recently.
37 >
38 > --- linux-2.6.36-hardened-r7/net/irda/af_irda.c 2010-10-20
39 > 22:30:22.000000000 +0200
40 > +++ linux-2.6.36-hardened-r8/net/irda/af_irda.c 2011-01-13
41 > 13:08:57.000000000 +0100
42 > @@ -2278,6 +2278,17 @@
43 >
44 > switch (optname) {
45 > case IRLMP_ENUMDEVICES:
46 > +
47 > +
48 > + /* Offset to first device entry */
49 > + offset = sizeof(struct irda_device_list) -
50 > + sizeof(struct irda_device_info);
51 > +
52 > + if (len < offset) {
53 > + err = -EINVAL;
54 > + goto out;
55 > + }
56 > +
57 > /* Ask lmp for the current discovery log */
58 > discoveries = irlmp_get_discoveries(&list.len,
59 > self->mask.word,
60 > self->nslots);
61 > @@ -2287,15 +2298,9 @@
62 > err = 0;
63 >
64 > /* Write total list length back to client */
65 > - if (copy_to_user(optval, &list,
66 > - sizeof(struct irda_device_list) -
67 > - sizeof(struct irda_device_info)))
68 > + if (copy_to_user(optval, &list, offset))
69 > err = -EFAULT;
70 >
71 > - /* Offset to first device entry */
72 > - offset = sizeof(struct irda_device_list) -
73 > - sizeof(struct irda_device_info);
74 > -
75 > /* Copy the list itself - watch for overflow */
76 > if(list.len > 2048)
77 > {
78 >
79 > What are your suggestions?
80 >
81 > Thx:
82 > Dw.
83 > --
84 > dr Tóth Attila, Radiológus, 06-20-825-8057
85 > Attila Toth MD, Radiologist, +36-20-825-8057
86 >
87 >
88 >