FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Hardened

 
 
LinkBack Thread Tools
 
Old 01-13-2011, 06:23 PM
 
Default hardened-sources-2.6.36-r8

On 13 Jan 2011 at 20:38, "Tóth Attila" wrote:

> 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

this should already be fixed in the latest grsec patch.
 
Old 01-13-2011, 06:38 PM
"Tóth Attila"
 
Default hardened-sources-2.6.36-r8

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
 
Old 01-13-2011, 07:05 PM
"Tóth Attila"
 
Default hardened-sources-2.6.36-r8

What about this one?

--- af_irda.c 2011-01-13 20:41:26.000000000 +0100
+++ af_irda-dwokfur.c 2011-01-13 20:41:50.000000000 +0100
@@ -2286,7 +2286,7 @@

if (len < offset) {
err = -EINVAL;
- goto out;
+ goto bed;
}

/* Ask lmp for the current discovery log */

It still complains:

net/irda/af_irda.c: In function ‘irda_getsockopt’:
net/irda/af_irda.c:2258:27: warning: ‘discoveries’ may be used
uninitialized in this function
net/irda/af_irda.c:2258:27: note: ‘discoveries’ was declared here

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

2011.Január 13.(Cs) 20:38 idÅ‘pontban "Tóth Attila" ezt Ã*rta:
> 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
>
>
>
 
Old 01-13-2011, 07:10 PM
Matthew Thode
 
Default hardened-sources-2.6.36-r8

I had this issue with vanilla 2.6.32.27 patched with the 2.6.32.27 grsec patch (2-3 days ago).

On Thu, Jan 13, 2011 at 14:38, "Tóth Attila" <atoth@atoth.sote.hu> wrote:


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
 
Old 01-13-2011, 07:14 PM
Matthew Thode
 
Default hardened-sources-2.6.36-r8

Spender said he just fixed that VERY recently.

On Thu, Jan 13, 2011 at 15:10, Matthew Thode <mthode@mthode.org> wrote:


I had this issue with vanilla 2.6.32.27 patched with the 2.6.32.27 grsec patch (2-3 days ago).



On Thu, Jan 13, 2011 at 14:38, "Tóth Attila" <atoth@atoth.sote.hu> wrote:

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
 

Thread Tools




All times are GMT. The time now is 12:49 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org