# "lirc_serial: Unknown symbol verify_area" with 2.6.14

## steve_v

As the subject line says.

Gentoo-sources-2.6.14-r1

lirc-0.7.2

Compiles cleanly but lirc_serial module won't load  :Sad: 

"lirc_serial: Unknown symbol verify_area"

Any ideas?

Cheers,

Steve.

----------

## rc

Hi,

i encountered that problem some while ago.

I found some way to make it work again though i think this "fix" is pretty crude.

My solution is to stop the emerge process after unpacking the sources via STRG+Z.

Then edit /var/tmp/portage/lirc-0.7.2/work/lirc-0.7.2/drivers/lirc_serial/lirc_serial.c and comment out the following two lines:

```

        retval=verify_area(VERIFY_READ,buf,n);

        if(retval) return(retval);

```

And finally continue the emerge process with fg.

As mentioned above i think this way is pretty crude.

Comments and suggestions are always appreciated.

Greetings,

rc

----------

## rc

Hi again,

i searched a bit around and it seems like that replacing "verify_area" with "access_ok" is sufficient.

http://www.gelato.unsw.edu.au/~dsw/public-files/kernel-docs/kernel-api/r3725.html

http://www.gelato.unsw.edu.au/~dsw/public-files/kernel-docs/kernel-api/r3676.html

Edit: Edited the file manually using the highly sophisticated STRG-Z method  :Wink:  and lirc_serial loads fine.

Greetings,

rc

----------

## Magic Michael

Thank you rc, you saved my day. Do we have a bug report for this lirc-issue ?

----------

## steve_v

```
--- lirc-0.7.2/drivers/lirc_serial/lirc_serial.c.orig   2005-04-23 23:40:01.000000000 +1200

+++ lirc-0.7.2/drivers/lirc_serial/lirc_serial.c   2005-11-12 18:34:25.000000000 +1300

@@ -913,7 +913,7 @@

 static ssize_t lirc_write(struct file *file, const char *buf,

           size_t n, loff_t * ppos)

 {

-   int retval,i,count;

+   int i,count;

    unsigned long flags;

    long delta=0;

    

@@ -921,13 +921,10 @@

    {

       return(-EBADF);

    }

-   

    if(n%sizeof(lirc_t)) return(-EINVAL);

-   retval=verify_area(VERIFY_READ,buf,n);

-   if(retval) return(retval);

    count=n/sizeof(lirc_t);

    if(count>WBUF_LEN || count%2==0) return(-EINVAL);

-   copy_from_user(wbuf,buf,n);

+   if(copy_from_user(wbuf,buf,n)) return -EFAULT;

    local_irq_save(flags);

    if(hardware[type].type==LIRC_IRDEO)

    {
```

----------

## elderet

Thank you for the patches! 

An alternative to the "STRG+Z"-method:

```

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild clean

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild fetch

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild unpack

```

Apply patch to: /var/tmp/portage/lirc-0.7.2/work/lirc-0.7.2/drivers/lirc_serial/lirc_serial.c

```

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild compile

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild install

ebuild /usr/portage/app-misc/lirc/lirc-0.7.2.ebuild qmerge

modprobe lirc_dev

modprobe lirc_serial

(/etc/init.d/lircd stop)

(/etc/init.d/lircd zap)

/etc/init.d/lircd start

```

LIRC is ALWAYS failing after upgrading the kernel... :-/

----------

## lion1977

Hi,

i've found the following replacement for verify_area in the lirc mailing list archive:

Replace 

```
retval=verify_area(type,addr,size);
```

 with 

```
retval=access_ok(type,addr,size) ? 0 : -EFAULT;
```

That should fix the problem. See http://sourceforge.net/mailarchive/message.php?msg_id=12912655

Another post on the list explained that the problem is solved in the cvs-tree of lirc_serial.c (http://sourceforge.net/mailarchive/message.php?msg_id=13745204).

I believe that removing the check, as suggested above, is a bad idea. It would no longer be verified that the given memory area belongs to userspace.

There are already two bugs filed, dealing with this problem. bug 111820 and a duplicate bug 106683 which deals with the problem. An ebuild is attached to the first one. Maybe it helps.

----------

## nightmarez

i just emerged lirc-cvs from gentoo-de overlay and i works fine

----------

## fincoop

 *nightmarez wrote:*   

> i just emerged lirc-cvs from gentoo-de overlay and i works fine

 

How do you do that?

----------

## firestrike

hi,

a German description about the gentoo.de repository is here:

http://www.gentoo.de/main/de/downloads.xml

----------

## Crazy Fucker

merged lirc-cvs from gentoo-de and it gives me the same problem as the standard lirc ebuild   :Evil or Very Mad: 

----------

