mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: elena.reshetova@intel.com
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
	shannon.nelson@oracle.com, jag.raman@oracle.com,
	peterz@infradead.org, keescook@chromium.org
Subject: Re: [PATCH] sparc64: convert mdesc_handle.refcnt from atomic_t to refcount_t
Date: Wed, 15 Nov 2017 14:42:15 +0900 (KST)	[thread overview]
Message-ID: <20171115.144215.1875016289797792026.davem@davemloft.net> (raw)
In-Reply-To: <1508486277-24913-1-git-send-email-elena.reshetova@intel.com>

From: Elena Reshetova <elena.reshetova@intel.com>
Date: Fri, 20 Oct 2017 10:57:57 +0300

> atomic_t variables are currently used to implement reference
> counters with the following properties:
>  - counter is initialized to 1 using atomic_set()
>  - a resource is freed upon counter reaching zero
>  - once counter reaches zero, its further
>    increments aren't allowed
>  - counter schema uses basic atomic operations
>    (set, inc, inc_not_zero, dec_and_test, etc.)
> 
> Such atomic variables should be converted to a newly provided
> refcount_t type and API that prevents accidental counter overflows
> and underflows. This is important since overflows and underflows
> can lead to use-after-free situation and be exploitable.
> 
> The variable mdesc_handle.refcnt is used as pure reference counter.
> Convert it to refcount_t and fix up the operations.
> 
> Suggested-by: Kees Cook <keescook@chromium.org>
> Reviewed-by: David Windsor <dwindsor@gmail.com>
> Reviewed-by: Hans Liljestrand <ishkamiel@gmail.com>
> Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>

Applied.

      parent reply	other threads:[~2017-11-15  5:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20  7:57 Elena Reshetova
2017-10-20 16:20 ` Shannon Nelson
2017-10-23  7:10   ` Reshetova, Elena
2017-10-23 15:19     ` Shannon Nelson
2017-11-15  5:42 ` David Miller [this message]

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=20171115.144215.1875016289797792026.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=elena.reshetova@intel.com \
    --cc=jag.raman@oracle.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=shannon.nelson@oracle.com \
    --cc=sparclinux@vger.kernel.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

all inboxes | Powered by JetHome®