linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: bfq: swap puts in bfqg_and_blkg_put
@ 2018-09-06  8:05 Konstantin Khlebnikov
  2018-09-06 17:30 ` Paolo Valente
  2018-09-06 17:33 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Konstantin Khlebnikov @ 2018-09-06  8:05 UTC (permalink / raw)
  To: linux-block, Jens Axboe, Paolo Valente, linux-kernel

Fix trivial use-after-free. This could be last reference to bfqg.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 8f9bebc33dd7 ("block, bfq: access and cache blkg data only when safe")
---
 block/bfq-cgroup.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 58c6efa9f9a9..9fe5952d117d 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -275,9 +275,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg)
 
 void bfqg_and_blkg_put(struct bfq_group *bfqg)
 {
-	bfqg_put(bfqg);
-
 	blkg_put(bfqg_to_blkg(bfqg));
+
+	bfqg_put(bfqg);
 }
 
 /* @stats = 0 */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: bfq: swap puts in bfqg_and_blkg_put
  2018-09-06  8:05 [PATCH] block: bfq: swap puts in bfqg_and_blkg_put Konstantin Khlebnikov
@ 2018-09-06 17:30 ` Paolo Valente
  2018-09-06 17:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Valente @ 2018-09-06 17:30 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: linux-block, Jens Axboe, linux-kernel



> Il giorno 06 set 2018, alle ore 10:05, Konstantin Khlebnikov <khlebnikov@yandex-team.ru> ha scritto:
> 
> Fix trivial use-after-free. This could be last reference to bfqg.
> 

Acked-by: Paolo Valente <paolo.valente@linaro.org>

> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: 8f9bebc33dd7 ("block, bfq: access and cache blkg data only when safe")
> ---
> block/bfq-cgroup.c |    4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
> index 58c6efa9f9a9..9fe5952d117d 100644
> --- a/block/bfq-cgroup.c
> +++ b/block/bfq-cgroup.c
> @@ -275,9 +275,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg)
> 
> void bfqg_and_blkg_put(struct bfq_group *bfqg)
> {
> -	bfqg_put(bfqg);
> -
> 	blkg_put(bfqg_to_blkg(bfqg));
> +
> +	bfqg_put(bfqg);
> }
> 
> /* @stats = 0 */
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: bfq: swap puts in bfqg_and_blkg_put
  2018-09-06  8:05 [PATCH] block: bfq: swap puts in bfqg_and_blkg_put Konstantin Khlebnikov
  2018-09-06 17:30 ` Paolo Valente
@ 2018-09-06 17:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-09-06 17:33 UTC (permalink / raw)
  To: Konstantin Khlebnikov, linux-block, Paolo Valente, linux-kernel

On 9/6/18 2:05 AM, Konstantin Khlebnikov wrote:
> Fix trivial use-after-free. This could be last reference to bfqg.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-06 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  8:05 [PATCH] block: bfq: swap puts in bfqg_and_blkg_put Konstantin Khlebnikov
2018-09-06 17:30 ` Paolo Valente
2018-09-06 17:33 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).