In the Linux kernel, the following vulnerability has been resolved:
block: fix integer overflow in BLKSECDISCARD
I independently rediscovered
commit 22d24a544b0d49bbcbd61c8c0eaf77d3c9297155
block: fix overflow in blk_ioctl_discard()
but for secure erase.
Same problem:
uint64_t r[2] = {512, 18446744073709551104ULL};
ioctl(fd, BLKSECDISCARD, r);
will enter near infinite loop inside blkdevissuesecure_erase():
a.out: attempt to access beyond end of device
loop0: rw=5, sector=3399043073, nr_sectors = 1024 limit=2048
bio_check_eod: 3286214 callbacks suppressed
[ { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@697ba0b6ec4ae04afb67d3911799b5e2043b4455", "signature_version": "v1", "target": { "function": "blk_ioctl_secure_erase", "file": "block/ioctl.c" }, "digest": { "function_hash": "299341015742556330920275387799188926638", "length": 654.0 }, "id": "CVE-2024-49994-1433749c" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8476f8428e8b48fd7a0e4258fa2a96a8f4468239", "signature_version": "v1", "target": { "function": "blk_ioctl_secure_erase", "file": "block/ioctl.c" }, "digest": { "function_hash": "328106195840500250542320504750875881274", "length": 673.0 }, "id": "CVE-2024-49994-14f1c5e4" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8476f8428e8b48fd7a0e4258fa2a96a8f4468239", "signature_version": "v1", "target": { "file": "block/ioctl.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "31552065129629078178618074242479306106", "102872226355865714484310780790741098518", "172541664694080482614222022999233005222", "192803673397621658012185324645161895296", "167597048610036741387705322229170571015", "131040851861491656218734352869400571349", "229345161169686870650380274434211535667", "17762307734844234821171125748596628113", "331746091833300255726459421843807472651", "128636578213975548214318764066822361920", "284828377618447160398362767678892940896", "257509217598080959761465285588408585652", "122680224538669441477524266745388385541", "48197300666676898165020032060967221194", "277168345405332360552572391896107336395" ] }, "id": "CVE-2024-49994-1ed64cf6" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@697ba0b6ec4ae04afb67d3911799b5e2043b4455", "signature_version": "v1", "target": { "file": "block/ioctl.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "239502578280670227048206993581673525084", "109685863821776842829657690469658749521", "264295397460436818618968326367236699106", "108239030319923390451337561827864819817", "80775402523237728329757385429019955903", "131040851861491656218734352869400571349", "229345161169686870650380274434211535667", "332843493128569802673438517131051514424", "331746091833300255726459421843807472651", "128636578213975548214318764066822361920", "304420477638764353862594941620016396345", "257439826535233346254604794325859923556", "222699837738325320177281791651154875786", "110146078337917258585550962523839718633", "277168345405332360552572391896107336395" ] }, "id": "CVE-2024-49994-29e4558f" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0842ddd83939eb4db940b9af7d39e79722bc41aa", "signature_version": "v1", "target": { "function": "blk_ioctl_discard", "file": "block/ioctl.c" }, "digest": { "function_hash": "7616305626622588231618629871413698871", "length": 1251.0 }, "id": "CVE-2024-49994-2d781a97" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0842ddd83939eb4db940b9af7d39e79722bc41aa", "signature_version": "v1", "target": { "file": "block/ioctl.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "239502578280670227048206993581673525084", "109685863821776842829657690469658749521", "264295397460436818618968326367236699106", "108239030319923390451337561827864819817", "80775402523237728329757385429019955903", "131040851861491656218734352869400571349", "229345161169686870650380274434211535667", "332843493128569802673438517131051514424", "331746091833300255726459421843807472651", "128636578213975548214318764066822361920", "304420477638764353862594941620016396345", "257439826535233346254604794325859923556", "222699837738325320177281791651154875786", "110146078337917258585550962523839718633", "277168345405332360552572391896107336395" ] }, "id": "CVE-2024-49994-363402a8" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6c9915fa9410cbb9bd75ee283c03120046c56d3d", "signature_version": "v1", "target": { "function": "blk_ioctl_discard", "file": "block/ioctl.c" }, "digest": { "function_hash": "7616305626622588231618629871413698871", "length": 1251.0 }, "id": "CVE-2024-49994-503e523a" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8476f8428e8b48fd7a0e4258fa2a96a8f4468239", "signature_version": "v1", "target": { "function": "blk_ioctl_discard", "file": "block/ioctl.c" }, "digest": { "function_hash": "286874675066385351450549715119745443170", "length": 763.0 }, "id": "CVE-2024-49994-52f89be7" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@697ba0b6ec4ae04afb67d3911799b5e2043b4455", "signature_version": "v1", "target": { "function": "blk_ioctl_discard", "file": "block/ioctl.c" }, "digest": { "function_hash": "7616305626622588231618629871413698871", "length": 1251.0 }, "id": "CVE-2024-49994-70831199" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6c9915fa9410cbb9bd75ee283c03120046c56d3d", "signature_version": "v1", "target": { "function": "blk_ioctl_secure_erase", "file": "block/ioctl.c" }, "digest": { "function_hash": "299341015742556330920275387799188926638", "length": 654.0 }, "id": "CVE-2024-49994-826900cf" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0842ddd83939eb4db940b9af7d39e79722bc41aa", "signature_version": "v1", "target": { "function": "blk_ioctl_secure_erase", "file": "block/ioctl.c" }, "digest": { "function_hash": "299341015742556330920275387799188926638", "length": 654.0 }, "id": "CVE-2024-49994-b0ed167e" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a99bacb35c1416355eef957560e8fcac3a665549", "signature_version": "v1", "target": { "function": "blk_ioctl_secure_erase", "file": "block/ioctl.c" }, "digest": { "function_hash": "130570413120801492039687029619428129746", "length": 676.0 }, "id": "CVE-2024-49994-d8e7e760" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6c9915fa9410cbb9bd75ee283c03120046c56d3d", "signature_version": "v1", "target": { "file": "block/ioctl.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "239502578280670227048206993581673525084", "109685863821776842829657690469658749521", "264295397460436818618968326367236699106", "108239030319923390451337561827864819817", "80775402523237728329757385429019955903", "131040851861491656218734352869400571349", "229345161169686870650380274434211535667", "332843493128569802673438517131051514424", "331746091833300255726459421843807472651", "128636578213975548214318764066822361920", "304420477638764353862594941620016396345", "257439826535233346254604794325859923556", "222699837738325320177281791651154875786", "110146078337917258585550962523839718633", "277168345405332360552572391896107336395" ] }, "id": "CVE-2024-49994-eb211353" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a99bacb35c1416355eef957560e8fcac3a665549", "signature_version": "v1", "target": { "function": "blk_ioctl_discard", "file": "block/ioctl.c" }, "digest": { "function_hash": "280923426945575890923862354987731636144", "length": 766.0 }, "id": "CVE-2024-49994-fc240c67" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a99bacb35c1416355eef957560e8fcac3a665549", "signature_version": "v1", "target": { "file": "block/ioctl.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "31552065129629078178618074242479306106", "102872226355865714484310780790741098518", "172541664694080482614222022999233005222", "192803673397621658012185324645161895296", "80775402523237728329757385429019955903", "131040851861491656218734352869400571349", "229345161169686870650380274434211535667", "332843493128569802673438517131051514424", "331746091833300255726459421843807472651", "128636578213975548214318764066822361920", "284828377618447160398362767678892940896", "257509217598080959761465285588408585652", "122680224538669441477524266745388385541", "48197300666676898165020032060967221194", "277168345405332360552572391896107336395" ] }, "id": "CVE-2024-49994-fda84a9f" } ]