In the Linux kernel, the following vulnerability has been resolved:
x86/MCE/AMD: Use an u64 for bank_map
Thee maximum number of MCA banks is 64 (MAXNRBANKS), see
a0bc32b3cacf ("x86/mce: Increase maximum number of banks to 64").
However, the bank_map which contains a bitfield of which banks to initialize is of type unsigned int and that overflows when those bit numbers are >= 32, leading to UBSAN complaining correctly:
UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/mce/amd.c:1365:38 shift exponent 32 is too large for 32-bit type 'int'
Change the bankmap to a u64 and use the proper BITULL() macro when modifying bits in there.
[ bp: Rewrite commit message. ]
[ { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-0544a7c8", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-08b72f48", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9669fa17287c3af2bbd4868d4c8fdd9e57f8332e", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-104c4c62", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c58a0c1937c157dbdf82d5ab634d68c99f3098", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "281836589865858487440721822084084307040", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-1cf1992f", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ba8ffb1251eb629c2ec35220e3896cf4f7b888a7", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "241973149271828327322616112611692163106", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-2980a580", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c58a0c1937c157dbdf82d5ab634d68c99f3098", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-2a3ce3ab", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a9b9ea0e63a0ec5e97bf1219ab6dcbd55e362f83", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-35811abc", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-47f79c79", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9669fa17287c3af2bbd4868d4c8fdd9e57f8332e", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "241973149271828327322616112611692163106", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-4cd5746e", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9669fa17287c3af2bbd4868d4c8fdd9e57f8332e", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-4db5fc62", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "241973149271828327322616112611692163106", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-65075608", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c58a0c1937c157dbdf82d5ab634d68c99f3098", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-65a5e73d", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a9b9ea0e63a0ec5e97bf1219ab6dcbd55e362f83", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "281836589865858487440721822084084307040", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-6d394c3f", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ba8ffb1251eb629c2ec35220e3896cf4f7b888a7", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-6f7b76e1", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c58a0c1937c157dbdf82d5ab634d68c99f3098", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-7036951b", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67bb7521b6420d81dab7538c0686f18f7d6d09f4", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-839d7f4a", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67bb7521b6420d81dab7538c0686f18f7d6d09f4", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-9140884f", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a9b9ea0e63a0ec5e97bf1219ab6dcbd55e362f83", "target": { "function": "mce_threshold_create_device", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "339820862075140586523797002382894057974", "length": 638.0 }, "deprecated": false, "id": "CVE-2023-53474-9d5cd529", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67bb7521b6420d81dab7538c0686f18f7d6d09f4", "target": { "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "line_hashes": [ "241973149271828327322616112611692163106", "336273431211871072483152420102789431987", "298753826655314180508392016702620423684", "159843197677279938993395607311192876447", "54230192120445538450006222529750120446", "58952674502570894386905787555138508534", "191508519687819858956275047210106086313", "147308549885710734500744750691637177136", "157327633228863661209188632581463779312", "108334783305596617812233454035899803514", "309060662172294644948370509862698154034", "285706444386958201908395655260598037931", "61312687357245516582362485180004035066", "63135181023514806341633945940774741176", "170310257137972010044340463223991907979", "78482612281842969397183792690474303922", "70213645032333211412951992001552473020", "285055236395725601173341734426310040865", "336802458450729512510482414469670070906", "272636086160600749422359211720540725277", "329796526556600143946538047174970320920", "80689593856863459999513077881594265731", "238568090535499960113465160317206264475", "49055379839201561582462049625205025592", "203358692562352151452430367708831405930" ], "threshold": 0.9 }, "deprecated": false, "id": "CVE-2023-53474-ae7b0c67", "signature_type": "Line", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9669fa17287c3af2bbd4868d4c8fdd9e57f8332e", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-c74d816a", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67bb7521b6420d81dab7538c0686f18f7d6d09f4", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-cbc3edae", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ba8ffb1251eb629c2ec35220e3896cf4f7b888a7", "target": { "function": "prepare_threshold_block", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "300969305614249239233892494025215793336", "length": 875.0 }, "deprecated": false, "id": "CVE-2023-53474-d42412b9", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ba8ffb1251eb629c2ec35220e3896cf4f7b888a7", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-d5992a34", "signature_type": "Function", "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a9b9ea0e63a0ec5e97bf1219ab6dcbd55e362f83", "target": { "function": "amd_threshold_interrupt", "file": "arch/x86/kernel/cpu/mce/amd.c" }, "digest": { "function_hash": "48416625405674929166181727338112146226", "length": 484.0 }, "deprecated": false, "id": "CVE-2023-53474-f82478f2", "signature_type": "Function", "signature_version": "v1" } ]