qcacld-3.0: Fix possible NULL hdd context dereference
On dp_aggregation sysfs store or show, wiphy is fetched from hdd context without validation. This could result in possible NULL hdd context dereference. Fix is to validate the hdd context before dereference to get wiphy. Change-Id: I0d01f64e95c9aa3f09ccc940a64d5a25148c302e CRs-Fixed: 2726433
このコミットが含まれているのは:
@@ -47,12 +47,6 @@ static ssize_t
|
|||||||
__hdd_sysfs_dp_aggregation_show(struct hdd_context *hdd_ctx,
|
__hdd_sysfs_dp_aggregation_show(struct hdd_context *hdd_ctx,
|
||||||
struct kobj_attribute *attr, char *buf)
|
struct kobj_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (!wlan_hdd_validate_modules_state(hdd_ctx))
|
if (!wlan_hdd_validate_modules_state(hdd_ctx))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -69,6 +63,11 @@ static ssize_t hdd_sysfs_dp_aggregation_show(struct kobject *kobj,
|
|||||||
struct osif_psoc_sync *psoc_sync;
|
struct osif_psoc_sync *psoc_sync;
|
||||||
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||||
ssize_t errno_size;
|
ssize_t errno_size;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||||
|
if (ret != 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
||||||
&psoc_sync);
|
&psoc_sync);
|
||||||
@@ -93,10 +92,6 @@ __hdd_sysfs_dp_aggregation_store(struct hdd_context *hdd_ctx,
|
|||||||
int ret;
|
int ret;
|
||||||
ol_txrx_soc_handle dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
|
ol_txrx_soc_handle dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||||
|
|
||||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (!wlan_hdd_validate_modules_state(hdd_ctx) || !dp_soc)
|
if (!wlan_hdd_validate_modules_state(hdd_ctx) || !dp_soc)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -131,6 +126,11 @@ hdd_sysfs_dp_aggregation_store(struct kobject *kobj,
|
|||||||
struct osif_psoc_sync *psoc_sync;
|
struct osif_psoc_sync *psoc_sync;
|
||||||
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||||
ssize_t errno_size;
|
ssize_t errno_size;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||||
|
if (ret != 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
||||||
&psoc_sync);
|
&psoc_sync);
|
||||||
|
新しいイシューから参照
ユーザーをブロックする