lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAME+iufMQT-pWzxgc79NyZq-hW-6QU9FAJd1SV_UR+zR2erPOQ@mail.gmail.com>
Date:	Wed, 10 Aug 2011 09:16:46 +0900
From:	"Murali K. Vemuri" <vemuri.muralikrishna@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: kernel panic with simple driver

Hello there,

I have a small driver code with which I am randomly receiving kernel
panic. Can someone help me what is the mistake here?
The kernel panic is exactly caught to be at "add_timer (&my_timer) ".
I am able to get the print "Kicking off the timer" when the panic
happens.

Also, I could not observe any specific pattern in which the panic
occurs. But it is purely random. So far I was able to reproduce the
panic thrice out of 100+ attempts.

In all other attempts, my_dev_ioctl is called correctly and works correctly.

struct timer_list my_timer;

static int my_dev_ioctl(struct inode *inode, struct file *file,
                unsigned int cmd, unsigned long arg)
{
    switch(cmd)
    {
        case MATCH_CASE:
            if (timer_pending (&my_timer))
            {
                printk(KERN_ERR "Timer currently pending, not adding
any more\n");
            }
            else
            {
                printk(KERN_ERR "Kicking off the timer\n");
                add_timer(&my_timer);
            }
            break;
        default:
            break;
    }
    return 0;
}

static struct miscdevice my_dummy_dev =
{
    .minor = MISC_DYNAMIC_MINOR,
    .name = "dummy_dev",
    .fops = &my_dev_fops,
};

static int __init my_dev_init(void)
{
    /*initialize some GPIOs */
    init_timer (&my_timer);
    my_timer.data = 0;
    my_timer.expires = jiffies + msecs_to_jiffies(500);
    my_timer.function = ring_led_detect_timer;
    misc_register(&mbi5025_dev);
}
module_init(my_dev_init);


Thanks in advance
Murali
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ