{"push_id":1452038649,"size":1,"distinct_size":1,"ref":"refs/heads/stable/11","head":"1f3363e13948d1969ec6e286d3ed3fe8a2252969","before":"bd6ac65d6bc28f645b50a05e58f7332af97df9f3","commits":[{"sha":"1f3363e13948d1969ec6e286d3ed3fe8a2252969","author":{"name":"ken","email":"3200f537deaadd80eacef9cad73e33fd07e4d1af@FreeBSD.org"},"message":"MFC r307684, r307747\n  ------------------------------------------------------------------------\n  r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines\n\n  For CCBs allocated on the stack, we need to clear the entire CCB, not just\n  the header.  Otherwise stack garbage can lead to random flags getting set.\n\n  This showed up as 'camcontrol rescan all' failing with EINVAL because the\n  address type wasn't CAM_DATA_VADDR.\n\n  sbin/camcontrol/camcontrol.c:\n  \tIn rescan_or_reset_bus(), bzero the stack-allocated CCBs before\n  \tuse instead of clearing the body.\n\n  Sponsored by:\tSpectra Logic\n\n  ------------------------------------------------------------------------\n  r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines\n\n  Fix a problem in camcontrol(8) that cropped up with r307684.\n\n  In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs\n  before sending them to the kernel because there was stack garbage in there\n  that wound up meaning that bogus CCB flags were set.\n\n  While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were\n  failing previously), it broke the 'camcontrol rescan 0' (or any other\n  number) case when INVARIANTS are turned on.  Rescanning a single bus\n  reliably produced an assert in cam_periph_runccb():\n\n  panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0\n\n  The flags values don't make sense from the code.  Changing the CCBs in\n  rescan_or_reset_bus() from stack to heap allocated avoids the problem.\n\n  It would be better to understand why userland stack allocated CCBs don't\n  work properly, since there may be other code that breaks if stack allocated\n  CCBs don't work.\n\n  sbin/camcontrol/camcontrol.c:\n  \tIn rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead\n  \tof on the stack to avoid an assertion in cam_periph_runccb().\n\n  Sponsored by:\tSpectra Logic\n\n  ------------------------------------------------------------------------\n\nSponsored by:\tSpectra Logic","distinct":true,"url":"https://api.github.com/repos/freebsd/freebsd/commits/1f3363e13948d1969ec6e286d3ed3fe8a2252969"}]}
{"actor":{"display_login":"uqs"}}