public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, arve@android.com,
	stable@vger.kernel.org, riandrews@android.com,
	labbott@redhat.com, sumit.semwal@linaro.org
Subject: Re: [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour
Date: Thu, 25 Nov 2021 13:11:35 +0000	[thread overview]
Message-ID: <YZ+LhzpwQ7RJtDSs@google.com> (raw)
In-Reply-To: <YZ+Kc/M1qSaWfXPW@kroah.com>

On Thu, 25 Nov 2021, Greg KH wrote:

> On Thu, Nov 25, 2021 at 01:03:46PM +0000, Lee Jones wrote:
> > On Thu, 25 Nov 2021, Greg KH wrote:
> > 
> > > On Thu, Nov 25, 2021 at 12:46:23PM +0000, Lee Jones wrote:
> > > > On Thu, 25 Nov 2021, Greg KH wrote:
> > > > 
> > > > > On Thu, Nov 25, 2021 at 12:02:34PM +0000, Lee Jones wrote:
> > > > > > Supply additional checks in order to prevent unexpected results.
> > > > > > 
> > > > > > Fixes: b892bf75b2034 ("ion: Switch ion to use dma-buf")
> > > > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > > > > ---
> > > > > >  drivers/staging/android/ion/ion.c | 3 +++
> > > > > >  1 file changed, 3 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> > > > > > index 806e9b30b9dc8..30f359faba575 100644
> > > > > > --- a/drivers/staging/android/ion/ion.c
> > > > > > +++ b/drivers/staging/android/ion/ion.c
> > > > > > @@ -509,6 +509,9 @@ static void *ion_handle_kmap_get(struct ion_handle *handle)
> > > > > >  	void *vaddr;
> > > > > >  
> > > > > >  	if (handle->kmap_cnt) {
> > > > > > +		if (handle->kmap_cnt + 1 < handle->kmap_cnt)
> > > > > 
> > > > > What about using the nice helpers in overflow.h for this?
> > > > 
> > > > I haven't heard of these before.
> > > > 
> > > > Looks like they're not widely used.
> > > > 
> > > > I'll try them out and see how they go.
> > > > 
> > > > > > +			return ERR_PTR(-EOVERFLOW);
> > > > > > +
> > > > > >  		handle->kmap_cnt++;
> > > > > >  		return buffer->vaddr;
> > > > > >  	}
> > > > > 
> > > > > What stable kernel branch(es) is this for?
> > > > 
> > > > I assumed your magic scripts could determine this from the Fixes:
> > > > tag.  I'll be more explicit in v2.
> > > 
> > > The fixes tag says how far back for it to go, but not where to start
> > > that process from :)
> > 
> > What's your preferred method for identifying a start-point?
> > 
> > In the [PATCH] tag or appended on to Cc: stable ... # <here>?
> > 
> > I know both work, but what makes your life easier?
> 
> Easiest is below the --- line say:
> ---
>  This is for kernel versions X.X and older.

Understood, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2021-11-25 13:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 12:02 [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour Lee Jones
2021-11-25 12:15 ` Greg KH
2021-11-25 12:46   ` Lee Jones
2021-11-25 12:54     ` Greg KH
2021-11-25 13:03       ` Lee Jones
2021-11-25 13:06         ` Greg KH
2021-11-25 13:11           ` Lee Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-25 14:20 Lee Jones
2021-11-25 14:50 ` Dan Carpenter
2021-11-25 15:07   ` Lee Jones
2021-11-25 15:15     ` Lee Jones
2021-11-25 15:18     ` Dan Carpenter
2021-11-25 15:28       ` Lee Jones
2021-11-26  7:16       ` Dan Carpenter
2021-11-26  8:56         ` Lee Jones
2021-11-26  9:02           ` Dan Carpenter
2021-11-26  9:03           ` Greg KH
2021-11-26  9:12             ` Lee Jones
2022-04-25 15:51 Lee Jones
2022-04-25 15:59 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZ+LhzpwQ7RJtDSs@google.com \
    --to=lee.jones@linaro.org \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=labbott@redhat.com \
    --cc=riandrews@android.com \
    --cc=stable@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox