public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-hardened] hardened-sources-2.6.36-r8
@ 2011-01-13 19:38 "Tóth Attila"
  2011-01-13 19:23 ` pageexec
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: "Tóth Attila" @ 2011-01-13 19:38 UTC (permalink / raw
  To: gentoo-hardened

Compiling the recent hardened-sources results in the following error
message, when irda is enabled:

  CC      net/irda/af_irda.o
net/irda/af_irda.c: In function ‘__irda_getsockopt’:
net/irda/af_irda.c:2289:4: error: label ‘out’ used but not defined

The changes causing it introduced recently.

--- linux-2.6.36-hardened-r7/net/irda/af_irda.c 2010-10-20
22:30:22.000000000 +0200
+++ linux-2.6.36-hardened-r8/net/irda/af_irda.c 2011-01-13
13:08:57.000000000 +0100
@@ -2278,6 +2278,17 @@

        switch (optname) {
        case IRLMP_ENUMDEVICES:
+
+
+               /* Offset to first device entry */
+               offset = sizeof(struct irda_device_list) -
+                       sizeof(struct irda_device_info);
+
+               if (len < offset) {
+                       err = -EINVAL;
+                       goto out;
+               }
+
                /* Ask lmp for the current discovery log */
                discoveries = irlmp_get_discoveries(&list.len,
self->mask.word,
                                                    self->nslots);
@@ -2287,15 +2298,9 @@
                err = 0;

                /* Write total list length back to client */
-               if (copy_to_user(optval, &list,
-                                sizeof(struct irda_device_list) -
-                                sizeof(struct irda_device_info)))
+               if (copy_to_user(optval, &list, offset))
                        err = -EFAULT;

-               /* Offset to first device entry */
-               offset = sizeof(struct irda_device_list) -
-                       sizeof(struct irda_device_info);
-
                /* Copy the list itself - watch for overflow */
                if(list.len > 2048)
                {

What are your suggestions?

Thx:
Dw.
-- 
dr Tóth Attila, Radiológus, 06-20-825-8057
Attila Toth MD, Radiologist, +36-20-825-8057




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-13 21:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 19:38 [gentoo-hardened] hardened-sources-2.6.36-r8 "Tóth Attila"
2011-01-13 19:23 ` pageexec
2011-01-13 20:05 ` "Tóth Attila"
2011-01-13 20:10 ` Matthew Thode
2011-01-13 20:14   ` Matthew Thode

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox