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:   Wed, 20 May 2020 15:02:29 +0530
From:   Arun Kumar Neelakantam <aneela@...eaurora.org>
To:     Mathieu Poirier <mathieu.poirier@...aro.org>
Cc:     ohad@...ery.com, bjorn.andersson@...aro.org, clew@...eaurora.org,
        sricharan@...eaurora.org, linux-remoteproc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Andy Gross <agross@...nel.org>,
        "open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH V5 5/5] rpmsg: glink: unregister rpmsg device during
 endpoint destroy


On 5/14/2020 3:43 AM, Mathieu Poirier wrote:
> On Wed, May 13, 2020 at 10:40:06AM +0530, Arun Kumar Neelakantam wrote:
>> Rpmsg device unregister is not happening if channel close is triggered
>> from local side and causing re-registration of device failures.
>>
>> Unregister rpmsg device for local close in endpoint destroy path.
>>
>> Signed-off-by: Arun Kumar Neelakantam <aneela@...eaurora.org>
>> ---
>>   drivers/rpmsg/qcom_glink_native.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
>> index 0e8a28c0..fc8ef66 100644
>> --- a/drivers/rpmsg/qcom_glink_native.c
>> +++ b/drivers/rpmsg/qcom_glink_native.c
>> @@ -1207,6 +1207,7 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
>>   {
>>   	struct glink_channel *channel = to_glink_channel(ept);
>>   	struct qcom_glink *glink = channel->glink;
>> +	struct rpmsg_channel_info chinfo;
>>   	unsigned long flags;
>>   
>>   	spin_lock_irqsave(&channel->recv_lock, flags);
>> @@ -1214,6 +1215,13 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
>>   	spin_unlock_irqrestore(&channel->recv_lock, flags);
>>   
>>   	/* Decouple the potential rpdev from the channel */
>> +	if (channel->rpdev) {
> If we proceed this way no other channel can have an rpdev.  I would hope that
> unregistration of rpdev would be more symetrical to what is done in patch 03.
>
> Thanks,
> Mathieu
Unregister here also required along with in qcom_glink_rx_close() 
otherwise if the remote open the channel again it map to stale rpmsg 
device.
>
>> +		strncpy(chinfo.name, channel->name, sizeof(chinfo.name));
>> +		chinfo.src = RPMSG_ADDR_ANY;
>> +		chinfo.dst = RPMSG_ADDR_ANY;
>> +
>> +		rpmsg_unregister_device(glink->dev, &chinfo);
>> +	}
>>   	channel->rpdev = NULL;
>>   
>>   	qcom_glink_send_close_req(glink, channel);
>> @@ -1477,6 +1485,7 @@ static void qcom_glink_rx_close(struct qcom_glink *glink, unsigned int rcid)
>>   
>>   		rpmsg_unregister_device(glink->dev, &chinfo);
>>   	}
>> +	channel->rpdev = NULL;
>>   
>>   	qcom_glink_send_close_ack(glink, channel->rcid);
>>   
>> -- 
>> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ