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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Sep 2023 22:17:56 +0800
From:   Qi Zheng <zhengqi.arch@...edance.com>
To:     akpm@...ux-foundation.org
Cc:     david@...morbit.com, tkhai@...ru, vbabka@...e.cz,
        roman.gushchin@...ux.dev, djwong@...nel.org, brauner@...nel.org,
        paulmck@...nel.org, tytso@....edu, steven.price@....com,
        cel@...nel.org, senozhatsky@...omium.org, yujie.liu@...el.com,
        gregkh@...uxfoundation.org, muchun.song@...ux.dev,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org, dan.carpenter@...aro.org
Subject: Re: [PATCH] fixup: mm: shrinker: add a secondary array for
 shrinker_info::{map, nr_deferred}

Hi Andrew,

After applying this fix patch, the following modifications also need to
be applied to the "[PATCH v6 45/45] mm: shrinker: convert shrinker_rwsem
to mutex".

diff --git a/mm/shrinker.c b/mm/shrinker.c
index 6857cbb520ea..dd91eab43ed3 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -96,7 +96,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
         return ret;

  err:
-       up_write(&shrinker_rwsem);
+       mutex_unlock(&shrinker_mutex);
         free_shrinker_info(memcg);
         return -ENOMEM;
  }

Or do I need to resend the entire patch set? If yes please let me know.

Thanks,
Qi

On 2023/9/28 22:15, Qi Zheng wrote:
> Dan Carpenter reported the following bug:
> 
> ```
> The patch b6884b5f15cf: "mm: shrinker: add a secondary array for
> shrinker_info::{map, nr_deferred}" from Sep 11, 2023 (linux-next),
> leads to the following Smatch static checker warning:
> 
> 	mm/shrinker.c:100 alloc_shrinker_info()
> 	warn: inconsistent returns '&shrinker_mutex'.
> ```
> 
> To fix it, unlock the &shrinker_rwsem before the call to
> free_shrinker_info().
> 
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/linux-mm/f960ae49-078c-4c00-9516-da31fc1a17d6@moroto.mountain/
> Signed-off-by: Qi Zheng <zhengqi.arch@...edance.com>
> ---
>   mm/shrinker.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/mm/shrinker.c b/mm/shrinker.c
> index 893079806553..e9644cda80b5 100644
> --- a/mm/shrinker.c
> +++ b/mm/shrinker.c
> @@ -95,6 +95,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
>   	return ret;
>   
>   err:
> +	up_write(&shrinker_rwsem);
>   	free_shrinker_info(memcg);
>   	return -ENOMEM;
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ