Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] cio: Make ccw_device_register() static.
[S390] Improve AP bus device removal.
[S390] uaccess error handling.
[S390] cio: css_probe_device() must be called enabled.
[S390] Initialize interval value to 0.
[S390] sys_getcpu compat wrapper.

+40 -29
+1
arch/s390/appldata/appldata_base.c
··· 310 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) { 311 return -EFAULT; 312 } 313 sscanf(buf, "%i", &interval); 314 if (interval <= 0) { 315 P_ERROR("Timer CPU interval has to be > 0!\n");
··· 310 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) { 311 return -EFAULT; 312 } 313 + interval = 0; 314 sscanf(buf, "%i", &interval); 315 if (interval <= 0) { 316 P_ERROR("Timer CPU interval has to be > 0!\n");
+3 -1
arch/s390/kernel/compat_linux.c
··· 757 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) 758 error = -EFAULT; 759 } 760 - copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); 761 } 762 return error; 763 }
··· 757 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) 758 error = -EFAULT; 759 } 760 + if (copy_to_user(args->__unused, tmp.__unused, 761 + sizeof(tmp.__unused))) 762 + error = -EFAULT; 763 } 764 return error; 765 }
+6 -6
arch/s390/kernel/compat_signal.c
··· 169 compat_old_sigset_t mask; 170 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 171 __get_user(sa_handler, &act->sa_handler) || 172 - __get_user(sa_restorer, &act->sa_restorer)) 173 return -EFAULT; 174 new_ka.sa.sa_handler = (__sighandler_t) sa_handler; 175 new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; 176 - __get_user(new_ka.sa.sa_flags, &act->sa_flags); 177 - __get_user(mask, &act->sa_mask); 178 siginitset(&new_ka.sa.sa_mask, mask); 179 } 180 ··· 185 sa_restorer = (unsigned long) old_ka.sa.sa_restorer; 186 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 187 __put_user(sa_handler, &oact->sa_handler) || 188 - __put_user(sa_restorer, &oact->sa_restorer)) 189 return -EFAULT; 190 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 191 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 192 } 193 194 return ret;
··· 169 compat_old_sigset_t mask; 170 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 171 __get_user(sa_handler, &act->sa_handler) || 172 + __get_user(sa_restorer, &act->sa_restorer) || 173 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 174 + __get_user(mask, &act->sa_mask)) 175 return -EFAULT; 176 new_ka.sa.sa_handler = (__sighandler_t) sa_handler; 177 new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; 178 siginitset(&new_ka.sa.sa_mask, mask); 179 } 180 ··· 185 sa_restorer = (unsigned long) old_ka.sa.sa_restorer; 186 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 187 __put_user(sa_handler, &oact->sa_handler) || 188 + __put_user(sa_restorer, &oact->sa_restorer) || 189 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 190 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 191 return -EFAULT; 192 } 193 194 return ret;
+1 -1
arch/s390/kernel/compat_wrapper.S
··· 1664 llgtr %r2,%r2 # unsigned * 1665 llgtr %r3,%r3 # unsigned * 1666 llgtr %r4,%r4 # struct getcpu_cache * 1667 - jg sys_tee
··· 1664 llgtr %r2,%r2 # unsigned * 1665 llgtr %r3,%r3 # unsigned * 1666 llgtr %r4,%r4 # struct getcpu_cache * 1667 + jg sys_getcpu
+6 -6
arch/s390/kernel/signal.c
··· 80 old_sigset_t mask; 81 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 82 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 83 - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 84 return -EFAULT; 85 - __get_user(new_ka.sa.sa_flags, &act->sa_flags); 86 - __get_user(mask, &act->sa_mask); 87 siginitset(&new_ka.sa.sa_mask, mask); 88 } 89 ··· 92 if (!ret && oact) { 93 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 94 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 95 - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 96 return -EFAULT; 97 - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 98 - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 99 } 100 101 return ret;
··· 80 old_sigset_t mask; 81 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 82 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 83 + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || 84 + __get_user(new_ka.sa.sa_flags, &act->sa_flags) || 85 + __get_user(mask, &act->sa_mask)) 86 return -EFAULT; 87 siginitset(&new_ka.sa.sa_mask, mask); 88 } 89 ··· 92 if (!ret && oact) { 93 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 94 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 95 + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || 96 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || 97 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) 98 return -EFAULT; 99 } 100 101 return ret;
+13 -7
arch/s390/kernel/traps.c
··· 462 local_irq_enable(); 463 464 if (regs->psw.mask & PSW_MASK_PSTATE) { 465 - get_user(*((__u16 *) opcode), (__u16 __user *) location); 466 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 467 if (current->ptrace & PT_PTRACED) 468 force_sig(SIGTRAP, current); ··· 471 signal = SIGILL; 472 #ifdef CONFIG_MATHEMU 473 } else if (opcode[0] == 0xb3) { 474 - get_user(*((__u16 *) (opcode+2)), location+1); 475 signal = math_emu_b3(opcode, regs); 476 } else if (opcode[0] == 0xed) { 477 - get_user(*((__u32 *) (opcode+2)), 478 - (__u32 __user *)(location+1)); 479 signal = math_emu_ed(opcode, regs); 480 } else if (*((__u16 *) opcode) == 0xb299) { 481 - get_user(*((__u16 *) (opcode+2)), location+1); 482 signal = math_emu_srnm(opcode, regs); 483 } else if (*((__u16 *) opcode) == 0xb29c) { 484 - get_user(*((__u16 *) (opcode+2)), location+1); 485 signal = math_emu_stfpc(opcode, regs); 486 } else if (*((__u16 *) opcode) == 0xb29d) { 487 - get_user(*((__u16 *) (opcode+2)), location+1); 488 signal = math_emu_lfpc(opcode, regs); 489 #endif 490 } else
··· 462 local_irq_enable(); 463 464 if (regs->psw.mask & PSW_MASK_PSTATE) { 465 + if (get_user(*((__u16 *) opcode), (__u16 __user *) location)) 466 + return; 467 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 468 if (current->ptrace & PT_PTRACED) 469 force_sig(SIGTRAP, current); ··· 470 signal = SIGILL; 471 #ifdef CONFIG_MATHEMU 472 } else if (opcode[0] == 0xb3) { 473 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 474 + return; 475 signal = math_emu_b3(opcode, regs); 476 } else if (opcode[0] == 0xed) { 477 + if (get_user(*((__u32 *) (opcode+2)), 478 + (__u32 __user *)(location+1))) 479 + return; 480 signal = math_emu_ed(opcode, regs); 481 } else if (*((__u16 *) opcode) == 0xb299) { 482 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 483 + return; 484 signal = math_emu_srnm(opcode, regs); 485 } else if (*((__u16 *) opcode) == 0xb29c) { 486 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 487 + return; 488 signal = math_emu_stfpc(opcode, regs); 489 } else if (*((__u16 *) opcode) == 0xb29d) { 490 + if (get_user(*((__u16 *) (opcode+2)), location+1)) 491 + return; 492 signal = math_emu_lfpc(opcode, regs); 493 #endif 494 } else
+3 -4
drivers/s390/cio/css.c
··· 271 /* Reset intparm to zeroes. */ 272 sch->schib.pmcw.intparm = 0; 273 cio_modify(sch); 274 - 275 - /* Probe if necessary. */ 276 - if (action == UNREGISTER_PROBE) 277 - ret = css_probe_device(sch->schid); 278 break; 279 case REPROBE: 280 device_trigger_reprobe(sch); ··· 279 break; 280 } 281 spin_unlock_irqrestore(&sch->lock, flags); 282 283 return ret; 284 }
··· 271 /* Reset intparm to zeroes. */ 272 sch->schib.pmcw.intparm = 0; 273 cio_modify(sch); 274 break; 275 case REPROBE: 276 device_trigger_reprobe(sch); ··· 283 break; 284 } 285 spin_unlock_irqrestore(&sch->lock, flags); 286 + /* Probe if necessary. */ 287 + if (action == UNREGISTER_PROBE) 288 + ret = css_probe_device(sch->schid); 289 290 return ret; 291 }
+1 -2
drivers/s390/cio/device.c
··· 532 533 /* this is a simple abstraction for device_register that sets the 534 * correct bus type and adds the bus specific files */ 535 - int 536 - ccw_device_register(struct ccw_device *cdev) 537 { 538 struct device *dev = &cdev->dev; 539 int ret;
··· 532 533 /* this is a simple abstraction for device_register that sets the 534 * correct bus type and adds the bus specific files */ 535 + static int ccw_device_register(struct ccw_device *cdev) 536 { 537 struct device *dev = &cdev->dev; 538 int ret;
-1
drivers/s390/cio/device.h
··· 78 79 int ccw_device_cancel_halt_clear(struct ccw_device *); 80 81 - int ccw_device_register(struct ccw_device *); 82 void ccw_device_do_unreg_rereg(void *); 83 void ccw_device_call_sch_unregister(void *); 84
··· 78 79 int ccw_device_cancel_halt_clear(struct ccw_device *); 80 81 void ccw_device_do_unreg_rereg(void *); 82 void ccw_device_call_sch_unregister(void *); 83
+6 -1
drivers/s390/crypto/ap_bus.c
··· 739 dev = bus_find_device(&ap_bus_type, NULL, 740 (void *)(unsigned long)qid, 741 __ap_scan_bus); 742 if (dev) { 743 put_device(dev); 744 continue; 745 } 746 - rc = ap_query_queue(qid, &queue_depth, &device_type); 747 if (rc) 748 continue; 749 rc = ap_init_queue(qid);
··· 739 dev = bus_find_device(&ap_bus_type, NULL, 740 (void *)(unsigned long)qid, 741 __ap_scan_bus); 742 + rc = ap_query_queue(qid, &queue_depth, &device_type); 743 + if (dev && rc) { 744 + put_device(dev); 745 + device_unregister(dev); 746 + continue; 747 + } 748 if (dev) { 749 put_device(dev); 750 continue; 751 } 752 if (rc) 753 continue; 754 rc = ap_init_queue(qid);