{
   "containers": {
      "cna": {
         "providerMetadata": {
            "orgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038"
         },
         "descriptions": [
            {
               "lang": "en",
               "value": "fs: sysfs_emit_at: Remove PAGE_SIZE alignment check\n\n\n[No upstream commit because this fixes a bug in a backport.]\n\nBefore upstream commit 59bb47985c1d (\"mm, sl[aou]b: guarantee natural\nalignment for kmalloc(power-of-two)\") which went into v5.4, kmalloc did\n*not* always guarantee that PAGE_SIZE allocations are PAGE_SIZE-aligned.\n\nUpstream commit 2efc459d06f1 (\"sysfs: Add sysfs_emit and sysfs_emit_at\nto format sysfs output\") added two WARN()s that trigger when PAGE_SIZE\nallocations are not PAGE_SIZE-aligned.  This was backported to old\nkernels that don't guarantee PAGE_SIZE alignment.\n\nCommit 10ddfb495232 (\"fs: sysfs_emit: Remove PAGE_SIZE alignment check\")\nin 4.19.y, and its equivalent in 4.14.y and 4.9.y, tried to fix this\nbug.  However, only it handled sysfs_emit(), not sysfs_emit_at().\n\nFix it in sysfs_emit_at() too.\n\nA reproducer is to build the kernel with the following options:\n\n\tCONFIG_SLUB=y\n\tCONFIG_SLUB_DEBUG=y\n\tCONFIG_SLUB_DEBUG_ON=y\n\tCONFIG_PM=y\n\tCONFIG_SUSPEND=y\n\tCONFIG_PM_WAKELOCKS=y\n\nThen run:\n\n\techo foo > /sys/power/wake_lock && cat /sys/power/wake_lock"
            }
         ],
         "affected": [
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "unaffected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "versions": [
                  {
                     "version": "cb1f69d53ac8",
                     "lessThan": "2a8664583d4d",
                     "status": "affected",
                     "versionType": "git"
                  }
               ]
            },
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "unaffected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "versions": [
                  {
                     "version": "4.19.179",
                     "lessThan": "4.19.279",
                     "status": "affected",
                     "versionType": "custom"
                  }
               ]
            }
         ],
         "references": [
            {
               "url": "https://git.kernel.org/stable/c/2a8664583d4d"
            }
         ],
         "title": "fs: sysfs_emit_at: Remove PAGE_SIZE alignment check",
         "x_generator": {
            "engine": "bippy-c4875b56942e"
         }
      }
   },
   "cveMetadata": {
      "assignerOrgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038",
      "cveID": "CVE-2023-21659",
      "requesterUserId": "gregkh@linuxfoundation.org",
      "serial": "1",
      "state": "PUBLISHED"
   },
   "dataType": "CVE_RECORD",
   "dataVersion": "5.0"
}
