Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"lirc_serial: Unknown symbol verify_area" with 2.6.14
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 401
Location: New Zealand

PostPosted: Sat Nov 12, 2005 5:25 am    Post subject: "lirc_serial: Unknown symbol verify_area" with 2.6 Reply with quote

As the subject line says.

Gentoo-sources-2.6.14-r1
lirc-0.7.2

Compiles cleanly but lirc_serial module won't load :-(
"lirc_serial: Unknown symbol verify_area"

Any ideas?

Cheers,

Steve.
Back to top
View user's profile Send private message
rc
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 234

PostPosted: Sat Nov 12, 2005 1:15 pm    Post subject: Reply with quote

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:
Code:

        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
Back to top
View user's profile Send private message
rc
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 234

PostPosted: Sat Nov 12, 2005 4:03 pm    Post subject: Reply with quote

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 ;) and lirc_serial loads fine.

Greetings,
rc
Back to top
View user's profile Send private message
Magic Michael
n00b
n00b


Joined: 02 Aug 2004
Posts: 53
Location: Berlin (West) / Deutschland

PostPosted: Sat Nov 12, 2005 4:54 pm    Post subject: Reply with quote

Thank you rc, you saved my day. Do we have a bug report for this lirc-issue ?
Back to top
View user's profile Send private message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 401
Location: New Zealand

PostPosted: Sun Nov 13, 2005 4:27 am    Post subject: Here's a <very> crude patch Reply with quote

Code:
--- 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)
    {
Back to top
View user's profile Send private message
elderet
n00b
n00b


Joined: 21 Mar 2004
Posts: 9
Location: Göteborg, Sweden

PostPosted: Thu Nov 17, 2005 5:27 pm    Post subject: Reply with quote

Thank you for the patches!

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

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
Code:

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... :-/
Back to top
View user's profile Send private message
lion1977
n00b
n00b


Joined: 21 Nov 2005
Posts: 5
Location: Linz, Austria

PostPosted: Mon Nov 21, 2005 8:42 pm    Post subject: Patch from lirc mailing list Reply with quote

Hi,

i've found the following replacement for verify_area in the lirc mailing list archive:
Replace
Code:
retval=verify_area(type,addr,size);
with
Code:
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.
Back to top
View user's profile Send private message
nightmarez
Tux's lil' helper
Tux's lil' helper


Joined: 17 May 2004
Posts: 111
Location: FSV Mainz 05 ;)

PostPosted: Mon Nov 28, 2005 10:15 am    Post subject: Reply with quote

i just emerged lirc-cvs from gentoo-de overlay and i works fine
_________________
Ecce quomodo moritur iustus
Back to top
View user's profile Send private message
fincoop
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2004
Posts: 143

PostPosted: Wed Dec 28, 2005 1:54 pm    Post subject: Reply with quote

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


How do you do that?
Back to top
View user's profile Send private message
firestrike
n00b
n00b


Joined: 05 May 2004
Posts: 22

PostPosted: Thu Dec 29, 2005 7:57 pm    Post subject: Reply with quote

hi,

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

http://www.gentoo.de/main/de/downloads.xml
Back to top
View user's profile Send private message
Crazy Fucker
n00b
n00b


Joined: 20 Feb 2005
Posts: 11
Location: Belgium

PostPosted: Fri Dec 30, 2005 3:29 pm    Post subject: Reply with quote

merged lirc-cvs from gentoo-de and it gives me the same problem as the standard lirc ebuild :evil:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum