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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48589759-88c1-4d13-9f08-321484180a7f@oracle.com>
Date: Fri, 24 Jan 2025 13:43:31 +0530
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: Yu Kuai <yukuai1@...weicloud.com>, LKML <linux-kernel@...r.kernel.org>,
        linux-raid@...r.kernel.org, mariusz.tkaczyk@...ux.intel.com,
        song@...nel.org, pmenzel@...gen.mpg.de
Cc: Himanshu Madhani <himanshu.madhani@...cle.com>,
        "regressions@...ts.linux.dev" <regressions@...ts.linux.dev>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Darren Kenny <darren.kenny@...cle.com>,
        "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [REGRESSION] kernel panic at bitmap_get_stats+0x2b/0xa0 since
 6.12

Hi Yu Kuai,

On 24/01/25 07:48, Yu Kuai wrote:
> 
> 
> 在 2025/01/24 9:30, Yu Kuai 写道:
...
>>
> 
> Please use this patch, I found that last patch has problem while
> testing.
> 

Thanks for the patch. After applying the below patch the problem is not 
reproducible anymore. The boot succeeds without panic.

Regards,
Harshit
> Thanks,
> 
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 63879582d1c3..e01c2d0479e3 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -2340,7 +2340,10 @@ static int bitmap_get_stats(void *data, struct 
> md_bitmap_stats *stats)
> 
>          if (!bitmap)
>                  return -ENOENT;
> -
> +       if (bitmap->mddev->bitmap_info.external)
> +               return -ENOENT;
> +       if (!bitmap->storage.sb_page) /* no superblock */
> +               return -EINVAL;
>          sb = kmap_local_page(bitmap->storage.sb_page);
>          stats->sync_size = le64_to_cpu(sb->sync_size);
>          kunmap_local(sb);
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 94166b2e9512..c9de57701e43 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8470,6 +8470,10 @@ static int md_seq_show(struct seq_file *seq, void 
> *v)
>                  return 0;
> 
>          spin_unlock(&all_mddevs_lock);
> +
> +       /* prevent bitmap to be freed after checking */
> +       mutex_lock(&mddev->bitmap_info.mutex);
> +
>          spin_lock(&mddev->lock);
>          if (mddev->pers || mddev->raid_disks || !list_empty(&mddev- 
>  >disks)) {
>                  seq_printf(seq, "%s : ", mdname(mddev));
> @@ -8545,6 +8549,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
>                  seq_printf(seq, "\n");
>          }
>          spin_unlock(&mddev->lock);
> +       mutex_unlock(&mddev->bitmap_info.mutex);
>          spin_lock(&all_mddevs_lock);
> 
>          if (mddev == list_last_entry(&all_mddevs, struct mddev, 
> all_mddevs))
> 



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ