linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elena Reshetova <elena.reshetova@intel.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
	netdev@vger.kernel.org, linux1394-devel@lists.sourceforge.net,
	linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-media@vger.kernel.org, devel@linuxdriverproject.org,
	linux-pci@vger.kernel.org, linux-s390@vger.kernel.org,
	fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org,
	open-iscsi@googlegroups.com, devel@driverdev.osuosl.org,
	target-devel@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-usb@vger.kernel.org, peterz@infradead.org,
	Elena Reshetova <elena.reshetova@intel.com>
Subject: [PATCH 00/29] drivers, mics refcount conversions
Date: Mon,  6 Mar 2017 16:20:47 +0200	[thread overview]
Message-ID: <1488810076-3754-1-git-send-email-elena.reshetova@intel.com> (raw)

This series, for various different drivers, replaces atomic_t reference
counters with the new refcount_t type and API (see include/linux/refcount.h).
By doing this we prevent intentional or accidental
underflows or overflows that can led to use-after-free vulnerabilities.

The below patches are fully independent and can be cherry-picked separately*.
Since we convert all kernel subsystems in the same fashion, resulting
in about 300 patches, we have to group them for sending at least in some
fashion to be manageable. Please excuse the long cc list.

*with the exception of the media/vb2-related patches that depend on
vb2_vmarea_handler.refcount conversions.

Not run-time tested beyond booting and using kernel with refcount conversions
for my daily work.

If there are no objections to these patches,
I think they can go via Greg's drivers tree, as he suggested before.

Elena Reshetova (29):
  drivers, block: convert xen_blkif.refcnt from atomic_t to refcount_t
  drivers, firewire: convert fw_node.ref_count from atomic_t to
    refcount_t
  drivers, char: convert vma_data.refcnt from atomic_t to refcount_t
  drivers, connector: convert cn_callback_entry.refcnt from atomic_t to
    refcount_t
  drivers, md, bcache: convert cached_dev.count from atomic_t to
    refcount_t
  drivers, md: convert dm_cache_metadata.ref_count from atomic_t to
    refcount_t
  drivers, md: convert dm_dev_internal.count from atomic_t to refcount_t
  drivers, md: convert mddev.active from atomic_t to refcount_t
  drivers, md: convert table_device.count from atomic_t to refcount_t
  drivers, md: convert stripe_head.count from atomic_t to refcount_t
  drivers, media: convert cx88_core.refcount from atomic_t to refcount_t
  drivers, media: convert s2255_dev.num_channels from atomic_t to
    refcount_t
  drivers, media: convert vb2_vmarea_handler.refcount from atomic_t to
    refcount_t
  drivers, media: convert vb2_dc_buf.refcount from atomic_t to
    refcount_t
  drivers, media: convert vb2_dma_sg_buf.refcount from atomic_t to
    refcount_t
  drivers, media: convert vb2_vmalloc_buf.refcount from atomic_t to
    refcount_t
  drivers, pci: convert hv_pci_dev.refs from atomic_t to refcount_t
  drivers, s390: convert urdev.ref_count from atomic_t to refcount_t
  drivers, s390: convert lcs_reply.refcnt from atomic_t to refcount_t
  drivers, s390: convert qeth_reply.refcnt from atomic_t to refcount_t
  drivers, s390: convert fc_fcp_pkt.ref_cnt from atomic_t to refcount_t
  drivers, scsi: convert iscsi_task.refcount from atomic_t to refcount_t
  drivers: convert vme_user_vma_priv.refcnt from atomic_t to refcount_t
  drivers: convert iblock_req.pending from atomic_t to refcount_t
  drivers, usb: convert ffs_data.ref from atomic_t to refcount_t
  drivers, usb: convert dev_data.count from atomic_t to refcount_t
  drivers, usb: convert ep_data.count from atomic_t to refcount_t
  drivers: convert sbd_duart.map_guard from atomic_t to refcount_t
  drivers, xen: convert grant_map.users from atomic_t to refcount_t

 drivers/block/xen-blkback/common.h             |  7 +--
 drivers/block/xen-blkback/xenbus.c             |  2 +-
 drivers/char/mspec.c                           |  9 ++--
 drivers/connector/cn_queue.c                   |  4 +-
 drivers/connector/connector.c                  |  2 +-
 drivers/firewire/core-topology.c               |  2 +-
 drivers/firewire/core.h                        |  8 ++--
 drivers/md/bcache/bcache.h                     |  7 +--
 drivers/md/bcache/super.c                      |  6 +--
 drivers/md/bcache/writeback.h                  |  2 +-
 drivers/md/dm-cache-metadata.c                 |  9 ++--
 drivers/md/dm-table.c                          |  6 +--
 drivers/md/dm.c                                | 12 +++--
 drivers/md/dm.h                                |  3 +-
 drivers/md/md.c                                |  6 +--
 drivers/md/md.h                                |  3 +-
 drivers/md/raid5-cache.c                       |  8 ++--
 drivers/md/raid5.c                             | 66 +++++++++++++-------------
 drivers/md/raid5.h                             |  3 +-
 drivers/media/pci/cx88/cx88-cards.c            |  2 +-
 drivers/media/pci/cx88/cx88-core.c             |  4 +-
 drivers/media/pci/cx88/cx88.h                  |  3 +-
 drivers/media/usb/s2255/s2255drv.c             | 21 ++++----
 drivers/media/v4l2-core/videobuf2-dma-contig.c | 11 +++--
 drivers/media/v4l2-core/videobuf2-dma-sg.c     | 11 +++--
 drivers/media/v4l2-core/videobuf2-memops.c     |  6 +--
 drivers/media/v4l2-core/videobuf2-vmalloc.c    | 11 +++--
 drivers/pci/host/pci-hyperv.c                  |  9 ++--
 drivers/s390/char/vmur.c                       |  8 ++--
 drivers/s390/char/vmur.h                       |  4 +-
 drivers/s390/net/lcs.c                         |  8 ++--
 drivers/s390/net/lcs.h                         |  3 +-
 drivers/s390/net/qeth_core.h                   |  3 +-
 drivers/s390/net/qeth_core_main.c              |  8 ++--
 drivers/scsi/libfc/fc_fcp.c                    |  6 +--
 drivers/scsi/libiscsi.c                        |  8 ++--
 drivers/scsi/qedi/qedi_iscsi.c                 |  2 +-
 drivers/staging/vme/devices/vme_user.c         | 10 ++--
 drivers/target/target_core_iblock.c            | 12 ++---
 drivers/target/target_core_iblock.h            |  3 +-
 drivers/tty/serial/sb1250-duart.c              | 18 +++----
 drivers/usb/gadget/function/f_fs.c             |  8 ++--
 drivers/usb/gadget/function/u_fs.h             |  3 +-
 drivers/usb/gadget/legacy/inode.c              | 17 +++----
 drivers/xen/gntdev.c                           | 11 +++--
 include/linux/connector.h                      |  4 +-
 include/media/videobuf2-memops.h               |  3 +-
 include/scsi/libfc.h                           |  3 +-
 include/scsi/libiscsi.h                        |  3 +-
 49 files changed, 203 insertions(+), 185 deletions(-)

-- 
2.7.4

             reply	other threads:[~2017-03-06 14:27 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 14:20 Elena Reshetova [this message]
2017-03-06 14:20 ` [PATCH 01/29] drivers, block: convert xen_blkif.refcnt from atomic_t to refcount_t Elena Reshetova
2017-03-06 14:20 ` [PATCH 02/29] drivers, firewire: convert fw_node.ref_count " Elena Reshetova
2017-03-06 14:20 ` [PATCH 03/29] drivers, char: convert vma_data.refcnt " Elena Reshetova
2017-03-06 14:20 ` [PATCH 04/29] drivers, connector: convert cn_callback_entry.refcnt " Elena Reshetova
2017-03-06 14:20 ` [PATCH 05/29] drivers, md, bcache: convert cached_dev.count " Elena Reshetova
2017-03-06 14:20 ` [PATCH 06/29] drivers, md: convert dm_cache_metadata.ref_count " Elena Reshetova
2017-03-06 14:20 ` [PATCH 07/29] drivers, md: convert dm_dev_internal.count " Elena Reshetova
2017-03-06 14:20 ` [PATCH 08/29] drivers, md: convert mddev.active " Elena Reshetova
2017-03-07 19:04   ` Shaohua Li
2017-03-08  9:42     ` Reshetova, Elena
2017-03-08 10:19       ` gregkh
2017-03-14 12:11   ` Michael Ellerman
2017-03-14 12:29     ` Reshetova, Elena
2017-03-14 14:58       ` James Bottomley
2017-03-16 18:00         ` Reshetova, Elena
2017-03-06 14:20 ` [PATCH 09/29] drivers, md: convert table_device.count " Elena Reshetova
2017-03-06 14:20 ` [PATCH 10/29] drivers, md: convert stripe_head.count " Elena Reshetova
2017-03-07 19:07   ` Shaohua Li
2017-03-08  9:39     ` Reshetova, Elena
2017-03-06 14:20 ` [PATCH 11/29] drivers, media: convert cx88_core.refcount " Elena Reshetova
2017-03-06 16:26   ` Sergei Shtylyov
2017-03-07  7:52     ` Reshetova, Elena
2017-03-07 10:40       ` Sergei Shtylyov
2017-03-07  8:22   ` Sakari Ailus
2017-03-06 14:20 ` [PATCH 12/29] drivers, media: convert s2255_dev.num_channels " Elena Reshetova
2017-03-07  8:30   ` Sakari Ailus
2017-03-07 14:45     ` Reshetova, Elena
2017-03-06 14:21 ` [PATCH 13/29] drivers, media: convert vb2_vmarea_handler.refcount " Elena Reshetova
2017-03-07  8:50   ` Sakari Ailus
2017-03-07 14:48     ` Reshetova, Elena
2017-03-06 14:21 ` [PATCH 14/29] drivers, media: convert vb2_dc_buf.refcount " Elena Reshetova
2017-03-06 14:21 ` [PATCH 15/29] drivers, media: convert vb2_dma_sg_buf.refcount " Elena Reshetova
2017-03-06 14:21 ` [PATCH 16/29] drivers, media: convert vb2_vmalloc_buf.refcount " Elena Reshetova
2017-03-06 14:21 ` [PATCH 17/29] drivers, pci: convert hv_pci_dev.refs " Elena Reshetova
2017-03-06 21:38   ` Bjorn Helgaas
2017-03-07 19:58     ` Stephen Hemminger
2017-04-18 10:40       ` Reshetova, Elena
2017-04-18 14:05         ` Bjorn Helgaas
2017-04-18 14:29           ` Reshetova, Elena
2017-03-06 14:21 ` [PATCH 18/29] drivers, s390: convert urdev.ref_count " Elena Reshetova
2017-03-06 14:21 ` [PATCH 19/29] drivers, s390: convert lcs_reply.refcnt " Elena Reshetova
2017-03-06 14:21 ` [PATCH 20/29] drivers, s390: convert qeth_reply.refcnt " Elena Reshetova
2017-03-06 14:21 ` [PATCH 21/29] drivers, s390: convert fc_fcp_pkt.ref_cnt " Elena Reshetova
2017-03-06 15:27   ` Johannes Thumshirn
2017-03-06 16:54     ` Benjamin Block
2017-03-07  7:50     ` Reshetova, Elena
2017-03-08 13:48     ` Reshetova, Elena
2017-03-08 14:06       ` Johannes Thumshirn
2017-03-06 14:21 ` [PATCH 22/29] drivers, scsi: convert iscsi_task.refcount " Elena Reshetova
2017-03-08 18:47   ` Chris Leech
2017-03-09  7:18     ` Reshetova, Elena
2017-03-09  8:43       ` Johannes Thumshirn
2017-03-09  9:26         ` Reshetova, Elena
2017-03-09  9:32           ` Johannes Thumshirn
2017-03-06 14:21 ` [PATCH 23/29] drivers: convert vme_user_vma_priv.refcnt " Elena Reshetova
2017-03-06 14:21 ` [PATCH 24/29] drivers: convert iblock_req.pending " Elena Reshetova
2017-03-08  7:37   ` Nicholas A. Bellinger
2017-03-21  7:18   ` Nicholas A. Bellinger
2017-03-06 14:21 ` [PATCH 25/29] drivers, usb: convert ffs_data.ref " Elena Reshetova
2017-03-06 14:21 ` [PATCH 26/29] drivers, usb: convert dev_data.count " Elena Reshetova
2017-03-06 14:21 ` [PATCH 27/29] drivers, usb: convert ep_data.count " Elena Reshetova
2017-03-06 14:21 ` [PATCH 28/29] drivers: convert sbd_duart.map_guard " Elena Reshetova
2017-03-06 14:21 ` [PATCH 29/29] drivers, xen: convert grant_map.users " Elena Reshetova
2017-03-06 16:58   ` [Xen-devel] " Boris Ostrovsky
2017-03-08 13:49     ` Reshetova, Elena
2017-03-08 17:45       ` Boris Ostrovsky
2017-03-09  7:19         ` Reshetova, Elena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488810076-3754-1-git-send-email-elena.reshetova@intel.com \
    --to=elena.reshetova@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=devel@linuxdriverproject.org \
    --cc=fcoe-devel@open-fcoe.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=open-iscsi@googlegroups.com \
    --cc=peterz@infradead.org \
    --cc=target-devel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).