In the Linux kernel, the following vulnerability has been resolved:
bpf: avoid holding freeze_mutex during mmap operation
We use map->freezemutex to prevent races between mapfreeze() and memory mapping BPF map contents with writable permissions. The way we naively do this means we'll hold freeze_mutex for entire duration of all the mm and VMA manipulations, which is completely unnecessary. This can potentially also lead to deadlocks, as reported by syzbot in [0].
So, instead, hold freeze_mutex only during writeability checks, bump (proactively) "write active" count for the map, unlock the mutex and proceed with mmap logic. And only if something went wrong during mmap logic, then undo that "write active" counter increment.
[0] https://lore.kernel.org/bpf/678dcbc9.050a0220.303755.0066.GAE@google.com/
[
{
"id": "CVE-2025-21853-030d8b71",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 827.0,
"function_hash": "185123146791081468415304748923096259255"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bc27c52eea189e8f7492d40739b7746d67b65beb",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-0744d446",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"327416963167786017170410115128116974061",
"319080417728771156350531013269393648801",
"128083021898699820620559065171117947364",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"309530699699429779977873011422494639043",
"137259455130661714960594138617140163214",
"290933910592144714996067162906423680959",
"300581081084732187539944758271123085569",
"223052825697687870597374952718436957968",
"122918009946875804174649446329583210393",
"325506599694062737958113333487031798121",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ce31c97c219b4fe797749f950274f246eb88c49",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-40dea504",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 820.0,
"function_hash": "325218199942775080007239549535595883847"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ce31c97c219b4fe797749f950274f246eb88c49",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-60a939d0",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"333210758619091409692104907403427427723",
"133437313272958912810812029271265715316",
"321413543313441948402984827251440674977",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"167131251210790372763238172042817631322",
"237835375352593954898277089642157699861",
"256414532815508333563657826066636680993",
"69525069543798577155484202296916614889",
"52654075843101779622889967870285218146",
"26405757424998162153152622163779948537",
"124222070463972998562617232779058791953",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d95607a5f2f9bb08194c9deaf4a5f3e8ba59a9d4",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-6da8b39f",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"121369035548725797167833381894732648857",
"14594796312539561289741948465441599148",
"338249817592314135189023164424823613585",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"309530699699429779977873011422494639043",
"137259455130661714960594138617140163214",
"290933910592144714996067162906423680959",
"300581081084732187539944758271123085569",
"223052825697687870597374952718436957968",
"122918009946875804174649446329583210393",
"325506599694062737958113333487031798121",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4759acbd44d24a69b7b14848012ec4201d6c5501",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-71bc04f3",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"121369035548725797167833381894732648857",
"12639745145029038398006925931913339598",
"335142123660432341412777649785233534523",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"309530699699429779977873011422494639043",
"137259455130661714960594138617140163214",
"290933910592144714996067162906423680959",
"300581081084732187539944758271123085569",
"223052825697687870597374952718436957968",
"122918009946875804174649446329583210393",
"325506599694062737958113333487031798121",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d90d9e154144a3a80e9fc0eb9b21b7fc990f68f",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-7fe0a6b1",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"333210758619091409692104907403427427723",
"133437313272958912810812029271265715316",
"321413543313441948402984827251440674977",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"167131251210790372763238172042817631322",
"237835375352593954898277089642157699861",
"256414532815508333563657826066636680993",
"69525069543798577155484202296916614889",
"52654075843101779622889967870285218146",
"26405757424998162153152622163779948537",
"124222070463972998562617232779058791953",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@29cfda62ab4d92ab94123813db49ab76c1e61b29",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-801966fd",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 860.0,
"function_hash": "306044933572919508373841076940366341133"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4759acbd44d24a69b7b14848012ec4201d6c5501",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-8e7aff96",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 827.0,
"function_hash": "185123146791081468415304748923096259255"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@29cfda62ab4d92ab94123813db49ab76c1e61b29",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-9af3c9de",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"333210758619091409692104907403427427723",
"133437313272958912810812029271265715316",
"321413543313441948402984827251440674977",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"167131251210790372763238172042817631322",
"237835375352593954898277089642157699861",
"256414532815508333563657826066636680993",
"69525069543798577155484202296916614889",
"52654075843101779622889967870285218146",
"26405757424998162153152622163779948537",
"124222070463972998562617232779058791953",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bc27c52eea189e8f7492d40739b7746d67b65beb",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-b7f18b25",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 840.0,
"function_hash": "38832022047690429323707147339524911326"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d90d9e154144a3a80e9fc0eb9b21b7fc990f68f",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-c3bb1a94",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 827.0,
"function_hash": "185123146791081468415304748923096259255"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@271e49f8a58edba65bc2b1250a0abaa98c4bfdbe",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-d8937cf9",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c"
},
"digest": {
"line_hashes": [
"85348866392382279009056847277303467371",
"333210758619091409692104907403427427723",
"133437313272958912810812029271265715316",
"321413543313441948402984827251440674977",
"176273645712503693446745308142151959195",
"329840855959293900126328601668002385996",
"175546978030776214969347976120628749255",
"167261828275983600060798697450760645781",
"167131251210790372763238172042817631322",
"237835375352593954898277089642157699861",
"256414532815508333563657826066636680993",
"69525069543798577155484202296916614889",
"52654075843101779622889967870285218146",
"26405757424998162153152622163779948537",
"124222070463972998562617232779058791953",
"236965623851576888198953978388587415440",
"316956129799014402425516164692835053717",
"193276213761853574574557313852492936109"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@271e49f8a58edba65bc2b1250a0abaa98c4bfdbe",
"signature_version": "v1"
},
{
"id": "CVE-2025-21853-f6a96a20",
"deprecated": false,
"target": {
"file": "kernel/bpf/syscall.c",
"function": "bpf_map_mmap"
},
"digest": {
"length": 827.0,
"function_hash": "185123146791081468415304748923096259255"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d95607a5f2f9bb08194c9deaf4a5f3e8ba59a9d4",
"signature_version": "v1"
}
]