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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Aug 2017 14:51:51 -0700
From:   Chris Lew <clew@...eaurora.org>
To:     Sricharan R <sricharan@...eaurora.org>, ohad@...ery.com,
        bjorn.andersson@...aro.org, linux-remoteproc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 11/20] rpmsg: glink: Fix idr_lock from mutex to
 spinlock

Hi Sricharan,

Minor bug in this patch.

On 8/24/2017 12:21 AM, Sricharan R wrote:
[..]
> @@ -829,11 +839,14 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid,
>   	struct device_node *node;
>   	int lcid;
>   	int ret;
> +	unsigned long flags;
>   
> +	spin_lock_irqsave(&glink->idr_lock, flags);
>   	idr_for_each_entry(&glink->lcids, channel, lcid) {
>   		if (!strcmp(channel->name, name))
>   			break;
>   	}
> +	spin_unlock_irqrestore(&glink->idr_lock, flags);
>   
>   	if (!channel) {
>   		channel = qcom_glink_alloc_channel(glink, name);
> @@ -844,15 +857,15 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid,
>   		create_device = true;
>   	}
>   
> -	mutex_lock(&glink->idr_lock);
> +	spin_lock_irqsave(&glink->idr_lock, flags);
>   	ret = idr_alloc(&glink->rcids, channel, rcid, rcid + 1, GFP_KERNEL);

I think GFP_KERNEL should be changed to GFP_ATOMIC if the mutex is 
changed to spinlock.

Thanks,
Chris
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ