From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PdUMO-0003JR-OF for garchives@archives.gentoo.org; Thu, 13 Jan 2011 21:05:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D320E091C for ; Thu, 13 Jan 2011 21:05:32 +0000 (UTC) Received: from mail-yi0-f53.google.com (mail-yi0-f53.google.com [209.85.218.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 254D9E07D6 for ; Thu, 13 Jan 2011 20:10:30 +0000 (UTC) Received: by yib17 with SMTP id 17so1015932yib.12 for ; Thu, 13 Jan 2011 12:10:30 -0800 (PST) Received: by 10.100.228.9 with SMTP id a9mr11531anh.77.1294949430507; Thu, 13 Jan 2011 12:10:30 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-hardened@lists.gentoo.org Reply-to: gentoo-hardened@lists.gentoo.org MIME-Version: 1.0 Received: by 10.100.231.8 with HTTP; Thu, 13 Jan 2011 12:10:09 -0800 (PST) In-Reply-To: References: From: Matthew Thode Date: Thu, 13 Jan 2011 15:10:09 -0500 Message-ID: Subject: Re: [gentoo-hardened] hardened-sources-2.6.36-r8 To: gentoo-hardened@lists.gentoo.org Content-Type: multipart/alternative; boundary=001636af01edceb82c0499bfe8ae X-Archives-Salt: 0ddaa9a8-58de-4f25-ac37-d3a73a955b20 X-Archives-Hash: d54ada174d6e3a9b7736e25850de7202 --001636af01edceb82c0499bfe8ae Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C3=B3th Attila" wro= te: > 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 =E2=80=98__irda_getsockopt=E2=80=99: > net/irda/af_irda.c:2289:4: error: label =E2=80=98out=E2=80=99 used but no= t 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 =3D sizeof(struct irda_device_list) - > + sizeof(struct irda_device_info); > + > + if (len < offset) { > + err =3D -EINVAL; > + goto out; > + } > + > /* Ask lmp for the current discovery log */ > discoveries =3D irlmp_get_discoveries(&list.len, > self->mask.word, > self->nslots); > @@ -2287,15 +2298,9 @@ > err =3D 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 =3D -EFAULT; > > - /* Offset to first device entry */ > - offset =3D 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=C3=B3th Attila, Radiol=C3=B3gus, 06-20-825-8057 > Attila Toth MD, Radiologist, +36-20-825-8057 > > > --001636af01edceb82c0499bfe8ae Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I had this issue with vanilla 2.6.32.27 patched with the 2.6.32.27 grsec pa= tch (2-3 days ago).

On Thu, Jan 13, 2011 = at 14:38, "T=C3=B3th Attila" <atoth@atoth.sote.hu> wrote:
Compiling the recent hardened-sources resul= ts in the following error
message, when irda is enabled:

=C2=A0CC =C2=A0 =C2=A0 =C2=A0net/irda/af_irda.o
net/irda/af_irda.c: In function =E2=80=98__irda_getsockopt=E2=80=99:
net/irda/af_irda.c:2289:4: error: label =E2=80=98out=E2=80=99 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 @@

=C2=A0 =C2=A0 =C2=A0 =C2=A0switch (optname) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0case IRLMP_ENUMDEVICES:
+
+
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Offset to first devic= e entry */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 offset =3D sizeof(struct= irda_device_list) -
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 sizeof(struct irda_device_info);
+
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (len < offset) { + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 err =3D -EINVAL;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 goto out;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Ask lmp for the = current discovery log */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0discoveries =3D irl= mp_get_discoveries(&list.len,
self->mask.word,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self->nslots);
@@ -2287,15 +2298,9 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D 0;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Write total list= length back to client */
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (copy_to_user(optval,= &list,
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof(struct irda_device_list) -
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof(struct irda_device_info)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (copy_to_user(optval,= &list, offset))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0err =3D -EFAULT;

- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Offset to first devic= e entry */
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 offset =3D sizeof(struct= irda_device_list) -
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 sizeof(struct irda_device_info);
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Copy the list it= self - watch for overflow */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if(list.len > 20= 48)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{

What are your suggestions?

Thx:
Dw.
--
dr T=C3=B3th Attila, Radiol=C3=B3gus, 06-20-825-8057
Attila Toth MD, Radiologist, +36-20-825-8057



--001636af01edceb82c0499bfe8ae--