lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 8 Jun 2015 23:51:45 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Yaniv Gardi <ygardi@...eaurora.org>
Cc:	Jej B <James.Bottomley@...senpartnership.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	linux-arm-msm@...r.kernel.org, Santosh Y <santoshsy@...il.com>,
	linux-scsi-owner@...r.kernel.org,
	Subhash Jadavani <subhashj@...eaurora.org>,
	Paul Bolle <pebolle@...cali.nl>,
	Gilad Broner <gbroner@...eaurora.org>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Vinayak Holikatti <vinholikatti@...il.com>,
	"James E.J. Bottomley" <JBottomley@...n.com>,
	Dolev Raviv <draviv@...eaurora.org>,
	Christoph Hellwig <hch@....de>,
	Sujit Reddy Thumma <sthumma@...eaurora.org>,
	Raviv Shvili <rshvili@...eaurora.org>,
	Sahitya Tummala <stummala@...eaurora.org>,
	"open list:OPEN FIRMWARE AND..." <devicetree@...r.kernel.org>
Subject: Re: [PATCH v3 4/4] scsi: ufs: probe and init of variant driver from
 the platform device

2015-06-08 1:27 GMT+09:00 Yaniv Gardi <ygardi@...eaurora.org>:
>  static int ufshcd_pltfrm_remove(struct platform_device *pdev)
>  {
>         struct ufs_hba *hba =  platform_get_drvdata(pdev);
> +       struct device_node *node = pdev->dev.of_node;
> +       struct device_node *ufs_variant_node;
> +       struct platform_device *ufs_variant_pdev;
> +
> +       ufs_variant_node = of_get_next_available_child(node, NULL);
> +
> +       if (!ufs_variant_node)
> +               dev_dbg(&pdev->dev, "no ufs_variant_node found\n");
> +       else
> +               ufs_variant_pdev = of_find_device_by_node(ufs_variant_node);
>
>         pm_runtime_get_sync(&(pdev)->dev);
>         ufshcd_remove(hba);
> +       module_put(ufs_variant_pdev->dev.driver->owner);

module_put() should only be called when ufs_variant sub-node exists
and hba->vops was found.
If ufs->vops == NULL or no ufs_variant sub-node exists, this line
causes uninitialized pointer dereference.

>         return 0;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ