Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ipmi' (minor ipmi fixes from Corey)

Merge ipmi fixes from Corey Minyard:
"Some minor fixes I had queued up. The last one came in recently
(patch 4) and it and patch 2 are candidates for stable-kernel."

* emailed patches from Corey Minyard <cminyard@mvista.com>:
ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex
ipmi: Improve error messages on failed irq enable
drivers/char/ipmi: memcpy, need additional 2 bytes to avoid memory overflow
drivers: char: ipmi: Replaced kmalloc and strcpy with kstrdup

+26 -11
+2 -2
drivers/char/ipmi/ipmi_bt_sm.c
··· 95 95 enum bt_states state; 96 96 unsigned char seq; /* BT sequence number */ 97 97 struct si_sm_io *io; 98 - unsigned char write_data[IPMI_MAX_MSG_LENGTH]; 98 + unsigned char write_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */ 99 99 int write_count; 100 - unsigned char read_data[IPMI_MAX_MSG_LENGTH]; 100 + unsigned char read_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */ 101 101 int read_count; 102 102 int truncated; 103 103 long timeout; /* microseconds countdown */
+13 -1
drivers/char/ipmi/ipmi_devintf.c
··· 837 837 return ipmi_ioctl(filep, cmd, arg); 838 838 } 839 839 } 840 + 841 + static long unlocked_compat_ipmi_ioctl(struct file *filep, unsigned int cmd, 842 + unsigned long arg) 843 + { 844 + int ret; 845 + 846 + mutex_lock(&ipmi_mutex); 847 + ret = compat_ipmi_ioctl(filep, cmd, arg); 848 + mutex_unlock(&ipmi_mutex); 849 + 850 + return ret; 851 + } 840 852 #endif 841 853 842 854 static const struct file_operations ipmi_fops = { 843 855 .owner = THIS_MODULE, 844 856 .unlocked_ioctl = ipmi_unlocked_ioctl, 845 857 #ifdef CONFIG_COMPAT 846 - .compat_ioctl = compat_ipmi_ioctl, 858 + .compat_ioctl = unlocked_compat_ipmi_ioctl, 847 859 #endif 848 860 .open = ipmi_open, 849 861 .release = ipmi_release,
+1 -2
drivers/char/ipmi/ipmi_msghandler.c
··· 2037 2037 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 2038 2038 if (!entry) 2039 2039 return -ENOMEM; 2040 - entry->name = kmalloc(strlen(name)+1, GFP_KERNEL); 2040 + entry->name = kstrdup(name, GFP_KERNEL); 2041 2041 if (!entry->name) { 2042 2042 kfree(entry); 2043 2043 return -ENOMEM; 2044 2044 } 2045 - strcpy(entry->name, name); 2046 2045 2047 2046 file = proc_create_data(name, 0, smi->proc_dir, proc_ops, data); 2048 2047 if (!file) {
+10 -6
drivers/char/ipmi/ipmi_si_intf.c
··· 663 663 /* We got the flags from the SMI, now handle them. */ 664 664 smi_info->handlers->get_result(smi_info->si_sm, msg, 4); 665 665 if (msg[2] != 0) { 666 - dev_warn(smi_info->dev, "Could not enable interrupts" 667 - ", failed get, using polled mode.\n"); 666 + dev_warn(smi_info->dev, 667 + "Couldn't get irq info: %x.\n", msg[2]); 668 + dev_warn(smi_info->dev, 669 + "Maybe ok, but ipmi might run very slowly.\n"); 668 670 smi_info->si_state = SI_NORMAL; 669 671 } else { 670 672 msg[0] = (IPMI_NETFN_APP_REQUEST << 2); ··· 687 685 688 686 /* We got the flags from the SMI, now handle them. */ 689 687 smi_info->handlers->get_result(smi_info->si_sm, msg, 4); 690 - if (msg[2] != 0) 691 - dev_warn(smi_info->dev, "Could not enable interrupts" 692 - ", failed set, using polled mode.\n"); 693 - else 688 + if (msg[2] != 0) { 689 + dev_warn(smi_info->dev, 690 + "Couldn't set irq info: %x.\n", msg[2]); 691 + dev_warn(smi_info->dev, 692 + "Maybe ok, but ipmi might run very slowly.\n"); 693 + } else 694 694 smi_info->interrupt_disabled = 0; 695 695 smi_info->si_state = SI_NORMAL; 696 696 break;