)]}'
{
  "commit": "027b2ab39b4dc72a0bdecc401f67fa816446d703",
  "tree": "425bc49df71ca37bc9082a8dc8bb787c6301c70c",
  "parents": [
    "06d84328555cdfa238ce824113583aaf7255d12e"
  ],
  "author": {
    "name": "Wang Liang",
    "email": "wangliang74@huawei.com",
    "time": "Sat Aug 30 15:50:23 2025 +0800"
  },
  "committer": {
    "name": "Daniel Velasquez",
    "email": "rdvelasquez@google.com",
    "time": "Sat Nov 01 13:18:52 2025 -0700"
  },
  "message": "pps: fix warning in pps_register_cdev when register device fail\n\n[ Upstream commit b0531cdba5029f897da5156815e3bdafe1e9b88d ]\n\nSimilar to previous commit 2a934fdb01db (\"media: v4l2-dev: fix error\nhandling in __video_register_device()\"), the release hook should be set\nbefore device_register(). Otherwise, when device_register() return error\nand put_device() try to callback the release function, the below warning\nmay happen.\n\n  ------------[ cut here ]------------\n  WARNING: CPU: 1 PID: 4760 at drivers/base/core.c:2567 device_release+0x1bd/0x240 drivers/base/core.c:2567\n  Modules linked in:\n  CPU: 1 UID: 0 PID: 4760 Comm: syz.4.914 Not tainted 6.17.0-rc3+ #1 NONE\n  RIP: 0010:device_release+0x1bd/0x240 drivers/base/core.c:2567\n  Call Trace:\n   \u003cTASK\u003e\n   kobject_cleanup+0x136/0x410 lib/kobject.c:689\n   kobject_release lib/kobject.c:720 [inline]\n   kref_put include/linux/kref.h:65 [inline]\n   kobject_put+0xe9/0x130 lib/kobject.c:737\n   put_device+0x24/0x30 drivers/base/core.c:3797\n   pps_register_cdev+0x2da/0x370 drivers/pps/pps.c:402\n   pps_register_source+0x2f6/0x480 drivers/pps/kapi.c:108\n   pps_tty_open+0x190/0x310 drivers/pps/clients/pps-ldisc.c:57\n   tty_ldisc_open+0xa7/0x120 drivers/tty/tty_ldisc.c:432\n   tty_set_ldisc+0x333/0x780 drivers/tty/tty_ldisc.c:563\n   tiocsetd drivers/tty/tty_io.c:2429 [inline]\n   tty_ioctl+0x5d1/0x1700 drivers/tty/tty_io.c:2728\n   vfs_ioctl fs/ioctl.c:51 [inline]\n   __do_sys_ioctl fs/ioctl.c:598 [inline]\n   __se_sys_ioctl fs/ioctl.c:584 [inline]\n   __x64_sys_ioctl+0x194/0x210 fs/ioctl.c:584\n   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n   do_syscall_64+0x5f/0x2a0 arch/x86/entry/syscall_64.c:94\n   entry_SYSCALL_64_after_hwframe+0x76/0x7e\n   \u003c/TASK\u003e\n\nBefore commit c79a39dc8d06 (\"pps: Fix a use-after-free\"),\npps_register_cdev() call device_create() to create pps-\u003edev, which will\ninit dev-\u003erelease to device_create_release(). Now the comment is outdated,\njust remove it.\n\nThanks for the reminder from Calvin Owens, \u0027kfree_pps\u0027 should be removed\nin pps_register_source() to avoid a double free in the failure case.\n\nBUG\u003db/456103711\nTEST\u003dpresubmit\nRELEASE_NOTE\u003dFixed CVE-2025-40070 in the Linux kernel.\n\ncos-patch: security-moderate\nLink: https://lore.kernel.org/all/20250827065010.3208525-1-wangliang74@huawei.com/\nFixes: c79a39dc8d06 (\"pps: Fix a use-after-free\")\nChange-Id: Idfc9ada481829b0e428ad9885628b74fa3df09d9\nSigned-off-by: Wang Liang \u003cwangliang74@huawei.com\u003e\nReviewed-By: Calvin Owens \u003ccalvin@wbinvd.org\u003e\nLink: https://lore.kernel.org/r/20250830075023.3498174-1-wangliang74@huawei.com\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\nSigned-off-by: Sasha Levin \u003csashal@kernel.org\u003e\nSigned-off-by: Kernel CVE Triage Automation \u003ccloud-image-kernel-cve-triage-automation@prod.google.com\u003e\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/116242\nReviewed-by: Daniel Velasquez \u003crdvelasquez@google.com\u003e\nReviewed-by: Dom Huh \u003cdomhuh@google.com\u003e\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "92d1b62ea239d7cb9c51841118e79482ab088662",
      "old_mode": 33188,
      "old_path": "drivers/pps/kapi.c",
      "new_id": "e9389876229eaa2b4a26c40668f02b203db12fbd",
      "new_mode": 33188,
      "new_path": "drivers/pps/kapi.c"
    },
    {
      "type": "modify",
      "old_id": "e1689957736d95b9daf4474755a958affaa07689",
      "old_mode": 33188,
      "old_path": "drivers/pps/pps.c",
      "new_id": "9539695b337a813364e2e3538383770e431f068b",
      "new_mode": 33188,
      "new_path": "drivers/pps/pps.c"
    }
  ]
}
