linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] More fixes for resource leaks and warnings
@ 2011-11-01 15:09 Jes.Sorensen
  2011-11-01 15:09 ` [PATCH 01/19] Grow_Add_device(): dev_open() return a negative fd on error Jes.Sorensen
                   ` (19 more replies)
  0 siblings, 20 replies; 24+ messages in thread
From: Jes.Sorensen @ 2011-11-01 15:09 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dledford

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Hi,

Another 'small' pile of fixes for various resource leaks, null pointer
dereferencing and out of bounds buffer access found by Coverity.

This is the bulk of these for now. Please notice that I haven't
touched super-ddf.c at all, and that is probably the single biggest
offender. Also note that I haven't addressed a number of warnings in
sysfs.c where we know for sure that files aren't bigger than a given
size. The tool obviously doesn't know this, so it spews warnings when
we strcpy() content we just read. While the code per-ce is probably
safe, we may want to switch to strncpy() just to reduce the noise
ratio?

Cheers,
Jes


Jes Sorensen (19):
  Grow_Add_device(): dev_open() return a negative fd on error
  Grow_addbitmap(): don't try to close a file descriptor which failed
    to open
  Incremental(): Check return value of dev_open() before trying to use
    it
  sysfs_unique_holder(): Check read() return value before using as
    buffer index
  remove_devices(): readlink returns -1 on error
  assemble_container_content(): fix memory leak
  Grow_restart(): free() offsets after use
  Assemble(): don't dup_super() before we need it.
  Detail(): Remember to free 'avail'
  Grow_reshape(): Fix another 'sra' leak
  enough_fd(): remember to free buffer for avail array
  Manage_subdevs(): avoid leaking super
  IncrementalScan(): Fix memory leak
  Managa_ro(): free() mdi before exiting
  Manage_runstop(): Avoid memory leak
  Monitor(): free allocated memory on exit
  bitmap_fd_read(): fix memory leak
  validate_geometry_imsm_volume(): Avoid NULL pointer dereference
  make_parts(): Avoid false positive security warning

 Assemble.c    |    9 +++++++--
 Detail.c      |    3 ++-
 Grow.c        |   19 +++++++++++++------
 Incremental.c |    7 +++++++
 Manage.c      |   56 ++++++++++++++++++++++++++++++++++++++++----------------
 Monitor.c     |    6 ++++++
 bitmap.c      |    3 +++
 mdopen.c      |   14 +++++++-------
 super-intel.c |    4 +++-
 sysfs.c       |    2 ++
 util.c        |    9 +++++----
 11 files changed, 95 insertions(+), 37 deletions(-)

-- 
1.7.6.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2011-11-02 21:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 15:09 [PATCH 00/19] More fixes for resource leaks and warnings Jes.Sorensen
2011-11-01 15:09 ` [PATCH 01/19] Grow_Add_device(): dev_open() return a negative fd on error Jes.Sorensen
2011-11-01 15:09 ` [PATCH 02/19] Grow_addbitmap(): don't try to close a file descriptor which failed to open Jes.Sorensen
2011-11-01 15:09 ` [PATCH 03/19] Incremental(): Check return value of dev_open() before trying to use it Jes.Sorensen
2011-11-01 15:09 ` [PATCH 04/19] sysfs_unique_holder(): Check read() return value before using as buffer index Jes.Sorensen
2011-11-01 15:09 ` [PATCH 05/19] remove_devices(): readlink returns -1 on error Jes.Sorensen
2011-11-01 15:09 ` [PATCH 06/19] assemble_container_content(): fix memory leak Jes.Sorensen
2011-11-01 15:09 ` [PATCH 07/19] Grow_restart(): free() offsets after use Jes.Sorensen
2011-11-01 15:09 ` [PATCH 08/19] Assemble(): don't dup_super() before we need it Jes.Sorensen
2011-11-01 15:09 ` [PATCH 09/19] Detail(): Remember to free 'avail' Jes.Sorensen
2011-11-01 15:09 ` [PATCH 10/19] Grow_reshape(): Fix another 'sra' leak Jes.Sorensen
2011-11-01 15:09 ` [PATCH 11/19] enough_fd(): remember to free buffer for avail array Jes.Sorensen
2011-11-01 15:09 ` [PATCH 12/19] Manage_subdevs(): avoid leaking super Jes.Sorensen
2011-11-01 15:09 ` [PATCH 13/19] IncrementalScan(): Fix memory leak Jes.Sorensen
2011-11-01 15:09 ` [PATCH 14/19] Managa_ro(): free() mdi before exiting Jes.Sorensen
2011-11-01 15:09 ` [PATCH 15/19] Manage_runstop(): Avoid memory leak Jes.Sorensen
2011-11-01 15:09 ` [PATCH 16/19] Monitor(): free allocated memory on exit Jes.Sorensen
2011-11-01 15:09 ` [PATCH 17/19] bitmap_fd_read(): fix memory leak Jes.Sorensen
2011-11-01 15:09 ` [PATCH 18/19] validate_geometry_imsm_volume(): Avoid NULL pointer dereference Jes.Sorensen
2011-11-01 15:09 ` [PATCH 19/19] make_parts(): Avoid false positive security warning Jes.Sorensen
2011-11-01 20:30   ` Jes Sorensen
2011-11-02  0:25 ` [PATCH 00/19] More fixes for resource leaks and warnings NeilBrown
2011-11-02 14:39   ` Jes Sorensen
2011-11-02 21:58     ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).