All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [patch added to 3.12-stable] target/iscsi: Fix double free in lio_target_tiqn_addtpg()
Date: Sat, 21 Jan 2017 08:40:55 +0100	[thread overview]
Message-ID: <20170121074102.25260-58-jslaby@suse.cz> (raw)
In-Reply-To: <20170121074102.25260-1-jslaby@suse.cz>

From: Dan Carpenter <dan.carpenter@oracle.com>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit a91918cd3ea11f91c68e08e1e8ce1b560447a80e upstream.

This iscsit_tpg_add_portal_group() function is only called from
lio_target_tiqn_addtpg().  Both functions free the "tpg" pointer on
error so it's a double free bug.  The memory is allocated in the caller
so it should be freed in the caller and not here.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
[ bvanassche: Added "Fix" at start of patch title ]
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/target/iscsi/iscsi_target_tpg.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index b713d63a86f7..ed4ea4ef1420 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -258,7 +258,6 @@ err_out:
 		iscsi_release_param_list(tpg->param_list);
 		tpg->param_list = NULL;
 	}
-	kfree(tpg);
 	return -ENOMEM;
 }
 
-- 
2.11.0


  parent reply	other threads:[~2017-01-21  7:42 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21  7:39 [patch added to 3.12-stable] ftrace/x86: Set ftrace_stub to weak to prevent gcc from using short jumps to it Jiri Slaby
2017-01-21  7:39 ` [patch added to 3.12-stable] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci: applying XHCI_PME_STUCK_QUIRK to Intel BXT B0 host Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: Add PCI ID for Intel Braswell Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add support for Intel Sunrise Point PCH Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add support for Intel Broxton SOC Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add ID for one more Intel Broxton platform Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add Intel Kabylake PCI ID Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: hda - Fix up GPIO for ASUS ROG Ranger Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ARM: davinci: da850: don't add emac clock to lookup table twice Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: storage: unusual_uas: Add JMicron JMS56x to unusual device Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: gadgetfs: restrict upper bound on device configuration size Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix unbounded memory allocation bug Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix use-after-free bug Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix checks of wTotalLength in config descriptors Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: fix problems with duplicate endpoint addresses Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: dummy-hcd: fix bug in stop_activity (handle ep0) Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: gadget: composite: Test get_alt() presence instead of set_alt() Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] xhci: workaround for hosts missing CAS bit Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] xhci: free xhci virtual devices with leaf nodes first Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: omninet: fix NULL-derefs at open and disconnect Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: quatech2: fix sleep-while-atomic in close Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: pl2303: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: keyspan_pda: verify endpoints at probe Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: spcp8x5: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: fix another " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: iuu_phoenix: fix " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: garmin_gps: fix memory leak on failed URB submit Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: ti_usb_3410_5052: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_edgeport: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: oti6858: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: cyberjack: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: kobil_sct: fix NULL-deref in write Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7840: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix use-after-free on probe errors Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix parport " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix parallel probe Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add Intel Gemini Lake PCI ID Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: musb: Fix trying to free already-free IRQ 4 Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: hub: Move hub_port_disable() to fix warning if PM is disabled Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: usb-audio: Fix bogus error return in snd_usb_create_stream() Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: kl5kusb105: abort on open exception path Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: phy: am335x-control: fix device and of_node leaks Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: bind to interface after fw download Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] staging: iio: ad7606: fix improper setting of oversampling pins Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: gadget: always unmap EP0 requests Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] hwmon: (ds620) Fix overflows seen when writing temperature limits Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] hwmon: (g762) Fix overflows and crash seen when writing limit attributes Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] clk: clk-wm831x: fix a logic error Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] iommu/amd: Fix the left value check of cmd buffer Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] scsi: mvsas: fix command_active typo Jiri Slaby
2017-01-21  7:40 ` Jiri Slaby [this message]
2017-01-21  7:40 ` [patch added to 3.12-stable] mmc: mmc_test: Uninitialized return value Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] md: MD_RECOVERY_NEEDED is set for mddev->recovery Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] powerpc/pci/rpadlpar: Fix device reference leaks Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] cred/userns: define current_user_ns() as a function Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] net: ti: cpmac: Fix compiler warning due to type confusion Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] tick/broadcast: Prevent NULL pointer dereference Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] usb: gadget: composite: always set ep->mult to a sensible value Jiri Slaby

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=20170121074102.25260-58-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=bart.vanassche@sandisk.com \
    --cc=dan.carpenter@oracle.com \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.