lkml.org 
[lkml]   [1998]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: 2.1.103: Still "Ugh at c0111691"
From
Date
deas@dont.spam.me.uni-hamburg.de (Andreas Steffan) writes:

> Trace: c48222c2 <isdn_tty_edit_at+42/16c>
> Trace: c481ea11 <isdn_tty_write+2e5/338>

Good job, isdn_tty_write() was not yet known to be a potential "Ugh" source.

Maybe, it is not really necessary to turn off interrupts in isdn_tty_write
(this requires some deeper analysis). Did you only observe "Ugh" messages
or additionally some other spourious behavior while or after the "Ugh"
appeared?

Anyway, the follwowing patch (quick and dirty, the additional copying will
have some performance impact when writing to isdn ttys) should help for now.

Henner

--- 2.1.103-i4ldev/drivers/isdn/isdn_tty.c Tue Mar 24 00:24:27 1998
+++ 2.1.103-ix25/drivers/isdn/isdn_tty.c Thu Jun 4 23:11:32 1998
@@ -1294,6 +1294,7 @@
{
int c;
int total = 0;
+ u_char * tmp = NULL;
ulong flags;
modem_info *info = (modem_info *) tty->driver_data;

@@ -1301,6 +1302,15 @@
return 0;
if (!tty)
return 0;
+ /* brute force method to fix user space access with interrupts off */
+ if(from_user) {
+ tmp = kmalloc(count,GFP_KERNEL);
+ if ( ! tmp ) return -ENOMEM;
+ if( copy_from_user(tmp,buf,count) ) return -EFAULT;
+ buf = tmp;
+ from_user = 0;
+ }
+ /* however, is turning of interrupts really necessary ? */
save_flags(flags);
cli();
while (1) {
@@ -1385,6 +1395,7 @@
if ((info->xmit_count) || (skb_queue_len(&info->xmit_queue)))
isdn_timer_ctrl(ISDN_TIMER_MODEMXMIT, 1);
restore_flags(flags);
+ if( tmp ) kfree(tmp);
return total;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.070 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site