2020-06-24 16:47:07

by Deepak Kumar Singh

[permalink] [raw]
Subject: [PATCH V7 2/4] rpmsg: Guard against null endpoint ops in destroy

From: Chris Lew <[email protected]>

In RPMSG GLINK the chrdev device will allocate an ept as part of the
rpdev creation. This device will not register endpoint ops even though
it has an allocated ept. Protect against the case where the device is
being destroyed.

Signed-off-by: Chris Lew <[email protected]>
Signed-off-by: Deepak Kumar Singh <[email protected]>
Signed-off-by: Arun Kumar Neelakantam <[email protected]>
---
drivers/rpmsg/rpmsg_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index a6361ca..91de940 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(rpmsg_create_ept);
*/
void rpmsg_destroy_ept(struct rpmsg_endpoint *ept)
{
- if (ept)
+ if (ept && ept->ops)
ept->ops->destroy_ept(ept);
}
EXPORT_SYMBOL(rpmsg_destroy_ept);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2020-08-07 08:01:15

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH V7 2/4] rpmsg: Guard against null endpoint ops in destroy

On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
> From: Chris Lew <[email protected]>
>
> In RPMSG GLINK the chrdev device will allocate an ept as part of the
> rpdev creation. This device will not register endpoint ops even though
> it has an allocated ept. Protect against the case where the device is
> being destroyed.
>
> Signed-off-by: Chris Lew <[email protected]>
> Signed-off-by: Deepak Kumar Singh <[email protected]>
> Signed-off-by: Arun Kumar Neelakantam <[email protected]>

Should this be marked for stable kernels?

And if so, what commit does this fix? Any reason the Fixes: tag was not
used here?

And what happened to this series? I don't see it in linux-next, did the
maintainer ignore it?

thanks,

greg k-h

2020-08-08 00:35:17

by Chris Lew

[permalink] [raw]
Subject: Re: [PATCH V7 2/4] rpmsg: Guard against null endpoint ops in destroy

Hi Greg,

On 8/7/2020 12:59 AM, Greg KH wrote:
> On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
>> From: Chris Lew <[email protected]>
>>
>> In RPMSG GLINK the chrdev device will allocate an ept as part of the
>> rpdev creation. This device will not register endpoint ops even though
>> it has an allocated ept. Protect against the case where the device is
>> being destroyed.
>>
>> Signed-off-by: Chris Lew <[email protected]>
>> Signed-off-by: Deepak Kumar Singh <[email protected]>
>> Signed-off-by: Arun Kumar Neelakantam <[email protected]>
>
> Should this be marked for stable kernels?
>
> And if so, what commit does this fix? Any reason the Fixes: tag was not
> used here?
>

The crash that this fixes doesn't show up unless one of the previous
patches in the series is applied.

[PATCH V6 3/5] rpmsg: glink: Add support for rpmsg glink chrdev

I'm not sure if the fixes tag should apply to this change or one of the
commits to the base rpmsg code.

> And what happened to this series? I don't see it in linux-next, did the
> maintainer ignore it?
>

I believe most of the review feedback for the series has been addressed
by Deepak. There is one remaining action item for me and Deepak to
provide more concrete evidence that the first patch in the series is
needed.

[PATCH V6 1/5] rpmsg: glink: Use complete_all for open states

> thanks,
>
> greg k-h
>

Thanks,
Chris

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

2020-08-08 05:56:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH V7 2/4] rpmsg: Guard against null endpoint ops in destroy

On Fri, Aug 07, 2020 at 05:33:53PM -0700, Chris Lew wrote:
> Hi Greg,
>
> On 8/7/2020 12:59 AM, Greg KH wrote:
> > On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
> > > From: Chris Lew <[email protected]>
> > >
> > > In RPMSG GLINK the chrdev device will allocate an ept as part of the
> > > rpdev creation. This device will not register endpoint ops even though
> > > it has an allocated ept. Protect against the case where the device is
> > > being destroyed.
> > >
> > > Signed-off-by: Chris Lew <[email protected]>
> > > Signed-off-by: Deepak Kumar Singh <[email protected]>
> > > Signed-off-by: Arun Kumar Neelakantam <[email protected]>
> >
> > Should this be marked for stable kernels?
> >
> > And if so, what commit does this fix? Any reason the Fixes: tag was not
> > used here?
> >
>
> The crash that this fixes doesn't show up unless one of the previous patches
> in the series is applied.
>
> [PATCH V6 3/5] rpmsg: glink: Add support for rpmsg glink chrdev
>
> I'm not sure if the fixes tag should apply to this change or one of the
> commits to the base rpmsg code.

That's a different series, why not merge this patch with that one so
there is no need for a fix if none of this has been merged yet?

> > And what happened to this series? I don't see it in linux-next, did the
> > maintainer ignore it?
> >
>
> I believe most of the review feedback for the series has been addressed by
> Deepak. There is one remaining action item for me and Deepak to provide more
> concrete evidence that the first patch in the series is needed.
>
> [PATCH V6 1/5] rpmsg: glink: Use complete_all for open states

Ok, thanks, just didn't want to see this get forgotten...

greg k-h