Memory leaks in blkdev when blkdev device is detached

Review Request #2460 — Created Nov. 21, 2019 and submitted

pwinder
illumos-gate
general

Detaching a blkdev from its parents causes a couple of memory leaks.
See bug 12009

Testing is detailed in bug 12009.
But, simply, a blkdev device was detached from an nvme driver and ::findleaks was used to confirm the memory leaks had gone.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
igork
  1. Ship It!
  2. 
      
randyf
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/uts/common/io/blkdev/blkdev.c (Diff revision 1)
     
     
     
    So I don't think we should use strlcpy down here. strlcpy() does an implicit strlen(src) as part of its return value. However, we know it's not safe to do a strlen(src) in cases due to the fact that we've been given an explicit bound for 'str' in len. I suspect we should just bcopy km_len bytes and then explicitly set a terminator.
  3. 
      
pwinder
mscheler
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
pwinder
Review request changed

Status: Closed (submitted)

Loading...