Show a cover letter.

GET /api/1.1/covers/2231075/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2231075,
    "url": "http://patchwork.ozlabs.org/api/1.1/covers/2231075/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/cover/20260430102313.95249-1-zhangzhanpeng.jasper@bytedance.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/67/?format=api",
        "name": "OpenSBI development",
        "link_name": "opensbi",
        "list_id": "opensbi.lists.infradead.org",
        "list_email": "opensbi@lists.infradead.org",
        "web_url": "https://github.com/riscv/opensbi",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260430102313.95249-1-zhangzhanpeng.jasper@bytedance.com>",
    "date": "2026-04-30T10:23:11",
    "name": "[0/2] lib: sbi: sse: fix interrupted context corruption",
    "submitter": {
        "id": 93288,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93288/?format=api",
        "name": "Zhanpeng Zhang",
        "email": "zhangzhanpeng.jasper@bytedance.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/cover/20260430102313.95249-1-zhangzhanpeng.jasper@bytedance.com/mbox/",
    "series": [
        {
            "id": 502269,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502269/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=502269",
            "date": "2026-04-30T10:23:11",
            "name": "lib: sbi: sse: fix interrupted context corruption",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502269/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/covers/2231075/comments/",
    "headers": {
        "Return-Path": "\n <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zqpC6ktX;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=desiato.20200630 header.b=J9+K4Tx7;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=U2nJrWNa;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5qyc2QSGz1yJr\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 20:23:47 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIOYV-00000005Bk8-45Ch;\n\tThu, 30 Apr 2026 10:23:39 +0000",
            "from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIOYT-00000005Bjs-32rq\n\tfor opensbi@bombadil.infradead.org;\n\tThu, 30 Apr 2026 10:23:38 +0000",
            "from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030])\n\tby desiato.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIOYO-000000077N0-2D2a\n\tfor opensbi@lists.infradead.org;\n\tThu, 30 Apr 2026 10:23:35 +0000",
            "by mail-pj1-x1030.google.com with SMTP id\n 98e67ed59e1d1-35d90833cacso562921a91.2\n        for <opensbi@lists.infradead.org>;\n Thu, 30 Apr 2026 03:23:26 -0700 (PDT)",
            "from FJ7FR2JRQ3.bytedance.net ([139.177.225.247])\n        by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-364dbeb2db0sm321070a91.10.2026.04.30.03.23.20\n        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n        Thu, 30 Apr 2026 03:23:23 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=QZgikwmDwgmXWFkiSutHtuRgQZ9ssSyWLA171V2EN28=; b=zqpC6ktXC7WYyf\n\tTY53Nu4tx8bj/a+tG/f8Y+aD2kovb6TeTipMbzxIHD6MRloXT4zxMBt5wp9xg5JD2x6GgqIkf+bYz\n\t5nmmEmlQxe8ma2h9IVnntW0X1rdVfBM9XdUgyb/vZuTGQideap0bPN6l1UPchjHnNHtLgtwC52WGf\n\tMZawRT9ozhaQfAMR0iY+KrGUkM5cpFVbSk3kzLkyFzqkosNfh6NnZq+B399MCvCJB48WzlwYnT9+l\n\ttjyLX/X6Aiera9vqfwDa6qsvVWrqZpvoPvh22Szv8ahxaezpXj2TPdO02RnnvH7gADQNocLqUhhS/\n\tHAB0f0BnjRDKJRk8R/HA==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version\n\t:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:\n\tContent-Description:In-Reply-To:References;\n\tbh=Xsd50O7EwlNhXePDo0+oXCZLfHVMCx2rzDk8ehf6CY4=; b=J9+K4Tx73OWF2i5GLTQGONBNXK\n\t7TDSCpLYPHlN7eDomHlSWIdF8yl0m4GnhHbMOK5AYbM4NjZvlQiSEVDmS0BANpD+fNDkJEYSoL+tA\n\tbrRNOt2yjIgFM9SnxCO7Xe3+SVARwyl1wsU2RxU0YZ3qGPfLwNkJooTsOY4OysXbGJ70U6l8cxH4U\n\tGPuphkTYZCdNZ9xEP6ogq9wv/N7Av/vAhJ4HZAcqYmc/BfzLWvDJWpuSU+4OcyNFdgIh5RQTccbR6\n\tpFlQitSoGe/hEEYVA9EiEP5cXNZ24pEskDTCJMVBCWoi0NY3nK/LS1MGdCROA5K4TDgZQ4fvQtYpb\n\tvh+b+7Ng==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=bytedance.com; s=google; t=1777544604; x=1778149404;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=Xsd50O7EwlNhXePDo0+oXCZLfHVMCx2rzDk8ehf6CY4=;\n        b=U2nJrWNaLi+Db2CVWWdrNBxGcCXE/aAoBVQylZLlAd+3mRAYWTnRrZNiL/CmG3AjP2\n         01wF/RdHZQZmsPj8IwYLJmiHTrSFHq7PI3/DrF9fnnyVA/lbLQMuDxz9gZRQQerIYapP\n         YdU1EPpM1ASk+SfSrv8goyMBle6VqxcviMcGgEmbDQkH93w+cMuyRxHtUMUPLawD4o2N\n         leS8kE1vYLP0Q+sijji4rayhVMuz6KhWxZeUhC7ibOf9C60ExVV8Sg7aY81hdsvREMyR\n         hQGUmIAiFbs/znlz1BD3uMiAkcVIsFQLoFQdP92q36z0u4ihH48oAJVf/PQKZ/ivulPv\n         yBNg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777544604; x=1778149404;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=Xsd50O7EwlNhXePDo0+oXCZLfHVMCx2rzDk8ehf6CY4=;\n        b=fXiTemh5UfItw7ajxR7lN3RNi3WdQqkytqhtmE4u3ySFjNPvtB8LJsEXPHYsSPtYkO\n         Fyx21oJAQq+oZfGQnakncZaKDy/Wz2L8N78qw8TUrMseQMaTpqozgA3JTo5G6lawWrep\n         IultJK0xnwNgkCHg61JwGzSJOZ1yu+zoycN0nL5gqo/XAibjf9Kbp/NUB427PoEvIGiS\n         /AsVqX5w8GPPCPtpA5kWyNie0zrcUeV+QQfPIoUs071Y1tcoGzERZ3Q91IBrBZbvj8sl\n         3zS4PrYugbw4qqsAzHVussMEv+4K4XRAMwR6mqZ81cPPxxfKPBNWUg4ICgYVDr+wuUSg\n         i/Zw==",
        "X-Gm-Message-State": "AOJu0YxD348Zsli3vEmqE6fUyhumzCOzVkPEhWHFzcPTvW9J+Thx4+ZN\n\tkOk+fqSgRDNrukK0IxX0cLrZczbOFhSMU5ze8vowH1ELGAMGei0OCfdbT34kpfOWzesZ5C4cwVC\n\tA1uuK",
        "X-Gm-Gg": "AeBDiet6qlxbB2rvHEpDL1L/y+Gmc9zzmQ69Z30SjgzyjkdS3ClfiL8y9PaLwYpa93T\n\tqErUZ9I8GVD6/DlpZPuOlTv/kQPEOhB5S84NGVcfTYw1DqwhhKX5UjM1riuehx5VA7h76VxZj42\n\tfOWcN+FP/LuqlQ5GvxqTr0XyRCKZs1L1CfjfPbXovTx9dkPTX1yi3inX730mthSFOfRfc1agw2A\n\tWXXM0ulhiEWOV6RJpqY8jdfPWlN8ZVSAJ3DglnB5vw0Y+7zuRUutTdN/FxvAlrPH0DKrWsGJqG4\n\tUvlLP6YVdKmACEqlJwp1epx+c82bAzbn4Cd2oKIWecvEcGNir7Y93pQlKGsweePDufQJxOGkBc6\n\tK+lB45Lmu7pXD3Fwyv/8d8OjATltqeIj6r16FlEbvYScd29KSTElgY+238y6m/VjZyrv57uDH8M\n\tnEyOv/tguljBzDBzUqsndf+2bdQj67umjP+wx+VAr4AID/3r5vhekOFL5LdJHo6aVR8cHl+AYGA\n\t9q1tENi3Q==",
        "X-Received": "by 2002:a17:90b:3c4e:b0:361:4521:d311 with SMTP id\n 98e67ed59e1d1-364c309c2b0mr2392740a91.18.1777544604364;\n        Thu, 30 Apr 2026 03:23:24 -0700 (PDT)",
        "From": "Zhanpeng Zhang <zhangzhanpeng.jasper@bytedance.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "cleger@rivosinc.com,\n\tanup@brainfault.org,\n\tatishp@atishpatra.org,\n\tcuiyunhui@bytedance.com,\n\tyuanzhu@bytedance.com,\n\tZhanpeng Zhang <zhangzhanpeng.jasper@bytedance.com>",
        "Subject": "[PATCH 0/2] lib: sbi: sse: fix interrupted context corruption",
        "Date": "Thu, 30 Apr 2026 18:23:11 +0800",
        "Message-ID": "<20260430102313.95249-1-zhangzhanpeng.jasper@bytedance.com>",
        "X-Mailer": "git-send-email 2.50.1",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260430_112333_137009_4F53067B ",
        "X-CRM114-Status": "GOOD (  11.92  )",
        "X-Spam-Score": "-0.2 (/)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"desiato.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  SSE `inject` builds a synthetic S-mode context to enter the\n    registered S-mode handler. After the handler calls `complete`,\n OpenSBI resumes\n    the context that was interrupted by the SSE event. That makes [...]\n Content analysis details:   (-0.2 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no\n                             trust\n                             [2607:f8b0:4864:20:0:0:0:1030 listed in]\n                             [list.dnswl.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature",
        "X-BeenThere": "opensbi@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<opensbi.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/opensbi/>",
        "List-Post": "<mailto:opensbi@lists.infradead.org>",
        "List-Help": "<mailto:opensbi-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"opensbi\" <opensbi-bounces@lists.infradead.org>",
        "Errors-To": "opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "SSE `inject` builds a synthetic S-mode context to enter the registered\nS-mode handler. After the handler calls `complete`, OpenSBI resumes the\ncontext that was interrupted by the SSE event. That makes the SSE\nentry/completion path different from a normal interrupt path: the state\nvisible while the handler is running is not necessarily the state that\nshould be restored when the handler completes.\n\nThe current code reconstructs part of the interrupted state from the\nhandler-visible trap state and from the ABI-visible interrupted flags.\nThat exposes two bugs:\n\n  - KVM Context Corruption\n\n    If SSE interrupts KVM guest execution, OpenSBI must restore the\n    virtualization state that was active before it entered the S-mode\n    handler context. Restoring only hstatus SPV/SPVP is insufficient on\n    a virtualization-enabled system because hstatus carries more H-mode\n    state. Likewise, MPV must come from the state captured before\n    OpenSBI rewrites the trap state for handler entry. Reconstructing\n    these values from handler-visible state can corrupt the KVM resume\n    context.\n    This follows the earlier discussion [1].\n\n  - SSE Handler's SSTATUS Leakage\n\n    SSE can interrupt kernel execution at any point and run a complex\n    handler. PMU-SSE is a real-world example: with PMU-SSE\n    enabled, `perf top` repeatedly enters the SSE handler and completion\n    paths at a high frequency. Any synthetic handler SIE/SPIE/SPP state\n    that leaks into the SSE-interrupted context is quickly exposed. With\n    the previous version, this could resume with mismatched privilege and\n    interrupt state and lead to an \"environment call from U-mode\" panic.\n\nFix this by adding OpenSBI's private resume-state to `sbi_sse_event`.\nThis state must persist from `inject` to `complete`, but it must not be\nstored in the SSE attributes: the attributes are ABI-visible and can be\nupdated by the S-mode handler. Patch 1 saves and restores hstatus and\nthe interrupted virtualization state. Patch 2 saves and restores the\ninterrupted S-mode SIE/SPIE/SPP bits as a unit.\n\nPATCH 1 is the OpenSBI side of the KVM context corruption fix. The\nrelated Linux side should preserve the kernel stvec in do_sse() to help\nprotect the virtualization context. I will send the relevant Linux\npatchset updates in the near future.\n\n[1] https://lore.kernel.org/r/9290f53d-3545-4299-9781-c1c558f71158@rivosinc.com\n\nZhanpeng Zhang (2):\n  lib: sbi: sse: fix KVM context corruption\n  lib: sbi: sse: fix SSE handler sstatus leakage\n\n lib/sbi/sbi_sse.c | 80 ++++++++++++++++++++++++++++++++-----------------------\n 1 file changed, 47 insertions(+), 33 deletions(-)"
}