In the Linux kernel, the following vulnerability has been resolved:
md: call _mdstopwrites in mdstop
From the link [1], we can see raid1d was running even after the path raiddtr -> mdstop -> _mdstop.
Let's stop write first in destructor to align with normal md-raid to fix the KASAN issue.
[1]. https://lore.kernel.org/linux-raid/CAPhsuW5gc4AakdGNdF8ubpezAuDLFOYUO_sfMZcec6hQFm8nhg@mail.gmail.com/T/#m7f12bf90481c02c6d2da68c64aeed4779b7df74a
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@661c01b2181d9413c799127f13143583b69f20fd",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-02bc1edd"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1678ca35b80a94d474fdc31e2497ce5d7ed52512",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "240802654051894801708140977367234112081",
"length": 113.0
},
"id": "CVE-2022-49987-15d90c28"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0dd84b319352bb8ba64752d4e45396d8b13e6018",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-1c976d64"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f42a9819ba84bed2e609a4dff56af37063dcabdc",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-26953012"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@690b5c90fd2d81fd1d2b6110fa36783232f6dce2",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-33399c8d"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@661c01b2181d9413c799127f13143583b69f20fd",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-3a057c51"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5a58fab556bfe618b4c9719eb85712d78c6cb10",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-452265da"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f42a9819ba84bed2e609a4dff56af37063dcabdc",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-51289be1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8e7fb19f1a744fd34e982633ced756fee0498ef7",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-542be67e"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1678ca35b80a94d474fdc31e2497ce5d7ed52512",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"134521897087877201611864095580297811309",
"254718278601112455449135310745360864247"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-92409d62"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0dd84b319352bb8ba64752d4e45396d8b13e6018",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-a0e9b432"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@690b5c90fd2d81fd1d2b6110fa36783232f6dce2",
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"105061344689114603930083235782667708133",
"89823889760161870767634973078578235539",
"163376683561811533799735079790780014416"
],
"threshold": 0.9
},
"id": "CVE-2022-49987-c0f002f2"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5a58fab556bfe618b4c9719eb85712d78c6cb10",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-cedc5a25"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8e7fb19f1a744fd34e982633ced756fee0498ef7",
"target": {
"function": "md_stop",
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "217590439742727178640832020657150493031",
"length": 126.0
},
"id": "CVE-2022-49987-e5d44e39"
}
]