)]}'
{
  "commit": "bb8764700d8188248bf4e2ed212c45600aa5c88c",
  "tree": "33d9ac82bf1af4c7d3f11981bc3639cdbbee9f57",
  "parents": [
    "b4af032ac46a2f82d471afc5b7cccd0ff3fc5a05"
  ],
  "author": {
    "name": "Kuniyuki Iwashima",
    "email": "kuniyu@amazon.com",
    "time": "Wed Apr 10 10:10:16 2024 -0700"
  },
  "committer": {
    "name": "Oleksandr Tymoshenko",
    "email": "ovt@google.com",
    "time": "Wed May 29 11:18:44 2024 +0000"
  },
  "message": "af_unix: Don\u0027t peek OOB data without MSG_OOB.\n\n[ Upstream commit 22dd70eb2c3d754862964377a75abafd3167346b ]\n\nCurrently, we can read OOB data without MSG_OOB by using MSG_PEEK\nwhen OOB data is sitting on the front row, which is apparently\nwrong.\n\n  \u003e\u003e\u003e from socket import *\n  \u003e\u003e\u003e c1, c2 \u003d socketpair(AF_UNIX, SOCK_STREAM)\n  \u003e\u003e\u003e c1.send(b\u0027a\u0027, MSG_OOB)\n  1\n  \u003e\u003e\u003e c2.recv(1, MSG_PEEK | MSG_DONTWAIT)\n  b\u0027a\u0027\n\nIf manage_oob() is called when no data has been copied, we only\ncheck if the socket enables SO_OOBINLINE or MSG_PEEK is not used.\nOtherwise, the skb is returned as is.\n\nHowever, here we should return NULL if MSG_PEEK is set and no data\nhas been copied.\n\nAlso, in such a case, we should not jump to the redo label because\nwe will be caught in the loop and hog the CPU until normal data\ncomes in.\n\nThen, we need to handle skb \u003d\u003d NULL case with the if-clause below\nthe manage_oob() block.\n\nWith this patch:\n\n  \u003e\u003e\u003e from socket import *\n  \u003e\u003e\u003e c1, c2 \u003d socketpair(AF_UNIX, SOCK_STREAM)\n  \u003e\u003e\u003e c1.send(b\u0027a\u0027, MSG_OOB)\n  1\n  \u003e\u003e\u003e c2.recv(1, MSG_PEEK | MSG_DONTWAIT)\n  Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  BlockingIOError: [Errno 11] Resource temporarily unavailable\n\nBUG\u003db/342491326\nTEST\u003dpresubmit\nRELEASE_NOTE\u003dNone\n\nFixes: 314001f0bf92 (\"af_unix: Add OOB support\")\nSigned-off-by: Kuniyuki Iwashima \u003ckuniyu@amazon.com\u003e\nLink: https://lore.kernel.org/r/20240410171016.7621-3-kuniyu@amazon.com\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\nSigned-off-by: Sasha Levin \u003csashal@kernel.org\u003e\nChange-Id: I1e7aa0f3f6c2c5ef20b7aca371a2f5240f84196a\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/72615\nReviewed-by: Arnav Kansal \u003crnv@google.com\u003e\nReviewed-by: Kevin Berry \u003ckpberry@google.com\u003e\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e2a2e22d210f68b9519938dd4423013de48b6d86",
      "old_mode": 33188,
      "old_path": "net/unix/af_unix.c",
      "new_id": "f66f867049015d328d168dab66b28b4bc06175e9",
      "new_mode": 33188,
      "new_path": "net/unix/af_unix.c"
    }
  ]
}
