Re: [WTF?] sys_tas() on m32r

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al Viro 写道:

asmlinkage int sys_tas(int *addr)
{
       int oldval;
       unsigned long flags;

       if (!access_ok(VERIFY_WRITE, addr, sizeof (int)))
               return -EFAULT;
       local_irq_save(flags);
       oldval = *addr;
       if (!oldval)
               *addr = 1;
       local_irq_restore(flags);
       return oldval;
}
in arch/m32r/kernel/sys_m32r.c.  Trivial oops *AND* ability to trigger
IO with interrupts disabled.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


The memory that parameter addr pointer is in user-space.
To access these memory, you should use function like copy_from_user().

-liyu




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux