GHSA-8H36-WFWW-P7V6

Vulnerability from github – Published: 2026-06-03 18:33 – Updated: 2026-06-05 09:33
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

drm/amd/display: Fix out-of-bounds stream encoder index v3

eng_id can be negative and that stream_enc_regs[] can be indexed out of bounds.

eng_id is used directly as an index into stream_enc_regs[], which has only 5 entries. When eng_id is 5 (ENGINE_ID_DIGF) or negative, this can access memory past the end of the array.

Add a bounds check using ARRAY_SIZE() before using eng_id as an index. The unsigned cast also rejects negative values.

This avoids out-of-bounds access.

Fixes the below smatch error: dcn*_resource.c: stream_encoder_create() may index stream_enc_regs[eng_id] out of bounds (size 5).

drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn351/dcn351_resource.c 1246 static struct stream_encoder dcn35_stream_encoder_create( 1247 enum engine_id eng_id, 1248 struct dc_context ctx) 1249 {

...

1255
1256         /* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
1257         if (eng_id <= ENGINE_ID_DIGF) {

ENGINE_ID_DIGF is 5. should <= be <?

Unrelated but, ugh, why is Smatch saying that "eng_id" can be negative? end_id is type signed long, but there are checks in the caller which prevent it from being negative.

1258                 vpg_inst = eng_id;
1259                 afmt_inst = eng_id;
1260         } else
1261                 return NULL;
1262

...

1281
1282         dcn35_dio_stream_encoder_construct(enc1, ctx, ctx->dc_bios,
1283                                         eng_id, vpg, afmt,

--> 1284 &stream_enc_regs[eng_id], ^^^^^^^^^^^^^^^^^^^^^^^ This stream_enc_regs[] array has 5 elements so we are one element beyond the end of the array.

...

1287         return &enc1->base;
1288 }

v2: use explicit bounds check as suggested by Roman/Dan; avoid unsigned int cast

v3: The compiler already knows how to compare the two values, so the cast (int) is not needed. (Roman)

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-46263"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-06-03T18:16:27Z",
    "severity": "HIGH"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amd/display: Fix out-of-bounds stream encoder index v3\n\neng_id can be negative and that stream_enc_regs[]\ncan be indexed out of bounds.\n\neng_id is used directly as an index into stream_enc_regs[], which has\nonly 5 entries. When eng_id is 5 (ENGINE_ID_DIGF) or negative, this can\naccess memory past the end of the array.\n\nAdd a bounds check using ARRAY_SIZE() before using eng_id as an index.\nThe unsigned cast also rejects negative values.\n\nThis avoids out-of-bounds access.\n\nFixes the below smatch error:\ndcn*_resource.c: stream_encoder_create() may index\nstream_enc_regs[eng_id] out of bounds (size 5).\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn351/dcn351_resource.c\n    1246 static struct stream_encoder *dcn35_stream_encoder_create(\n    1247         enum engine_id eng_id,\n    1248         struct dc_context *ctx)\n    1249 {\n\n    ...\n\n    1255\n    1256         /* Mapping of VPG, AFMT, DME register blocks to DIO block instance */\n    1257         if (eng_id \u003c= ENGINE_ID_DIGF) {\n\nENGINE_ID_DIGF is 5.  should \u003c= be \u003c?\n\nUnrelated but, ugh, why is Smatch saying that \"eng_id\" can be negative?\nend_id is type signed long, but there are checks in the caller which prevent it from being negative.\n\n    1258                 vpg_inst = eng_id;\n    1259                 afmt_inst = eng_id;\n    1260         } else\n    1261                 return NULL;\n    1262\n\n    ...\n\n    1281\n    1282         dcn35_dio_stream_encoder_construct(enc1, ctx, ctx-\u003edc_bios,\n    1283                                         eng_id, vpg, afmt,\n--\u003e 1284                                         \u0026stream_enc_regs[eng_id],\n                                                  ^^^^^^^^^^^^^^^^^^^^^^^ This stream_enc_regs[] array has 5 elements so we are one element beyond the end of the array.\n\n    ...\n\n    1287         return \u0026enc1-\u003ebase;\n    1288 }\n\nv2: use explicit bounds check as suggested by Roman/Dan; avoid unsigned int cast\n\nv3: The compiler already knows how to compare the two values, so the\n    cast (int) is not needed. (Roman)",
  "id": "GHSA-8h36-wfww-p7v6",
  "modified": "2026-06-05T09:33:46Z",
  "published": "2026-06-03T18:33:12Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-46263"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/263e28add4f4472cfa95150d218955d1945aa413"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/29f3824b08a98d41ecbbfd33580630d7607f962e"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/abde491143e4e12eecc41337910aace4e8d59603"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ca3808d560ad946ab6d089fd1f5bee04b952ead4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…