From nobody Tue Apr 09 00:03:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VD5lw5XkGz5G6sh; Tue, 9 Apr 2024 00:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VD5lw55dlz4Ysf; Tue, 9 Apr 2024 00:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712621036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TBapWDXLTlftrsbMBL9FBv55LA1QLJu1fszx/zUpmkI=; b=V44OxfCQ++CasgmEnr26KDueSBj3ajwPLyxH56byPTfhCoR//SvoEo0DI07jR/DAjid79n 0HOMfChng+tY/GpzsfUmHLeNoxwpqx1arUmkSV7rMicWD62qwsj0gU13HiZhWk76c9wxM8 WIekiU3E93qMb3DPw7lu9CGL6su3VPHMAHWO0MinzjtmsBLAuRqbJIIHqMmeKKDnzF4z2t u24pXra342Y0peTnB8pOqjR/J3mTdt/fVqfjXNF2lrUqxWSsrgADJWNP6JFlc8sjC0M9aO 1grvyjIuu1OBWJRb2VXgz+CD/8MMMxBSH5Kmdzjg7FKX43ucnLw/RpeIPtfdsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712621036; a=rsa-sha256; cv=none; b=Uz411JnRFt3qbYsA9AL6MFql88/3qsC6NL57LbWb2eO/V7B/F5l1EzYiZczpUI60RkzKa7 DEermc1Ghwo/PSeBBDTcuI11i+WAG0W5ghBAKvfjfhCfigVzyQaq20pj8Rb1NI0+jibkoT 9U1KvN50xNIDApY+3Ca5vN4TV7CICwijF4dmQDdmPbwHkjoHDcRVlfb6xtvPcPmKcY30A7 LIS8R1bG35MN31gqWsKBVXurx96f36Gb2oMx7PlBpHQcF3rVTy9pMJu6/xYMCLbzpsPTr1 frc248rPFNs2x9hvy4fLNcOzltn2a3T8s1g6pZIBgHSrKYBuRQEFo5FwFVRToQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712621036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TBapWDXLTlftrsbMBL9FBv55LA1QLJu1fszx/zUpmkI=; b=vmbB87sNe+PHITeS7Spt7R78fhbLaxXFuwtAXOE0MwNHFChZgC9daXg/y96KRywpACzR4G fNcoQ04O6CcNhZWntEq2NtaZ+PqfRS5yZhoXcA19DHvHoEBIoXqy6Ue15Il8NCJY64cTMp sOLU5EreYQ/QST30ljC/4MBGEy6LJksiJ7P/Z2SRRLzZ0hMLxzWeseMyupQZTQgg576O/L R2vEggjNLif4tfSrMyAGNfTBa9eALIZgn3LpzIl+2+NeteBTUkgFBGgugKhEWRGalprT3g kRFfNlKBf42BKxKYbL9YGEnLWNT43mHpZz1ArckUOatdh/+IUFY24BWLz2WoKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VD5lw4jnczY02; Tue, 9 Apr 2024 00:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43903uBc014892; Tue, 9 Apr 2024 00:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43903uVj014889; Tue, 9 Apr 2024 00:03:56 GMT (envelope-from git) Date: Tue, 9 Apr 2024 00:03:56 GMT Message-Id: <202404090003.43903uVj014889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d1cbb17a873c - main - unix: fix the ad hoc STAILQ_PREPEND() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1cbb17a873c787a527316bbb27551e97d5ad30c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d1cbb17a873c787a527316bbb27551e97d5ad30c commit d1cbb17a873c787a527316bbb27551e97d5ad30c Author: Gleb Smirnoff AuthorDate: 2024-04-09 00:02:00 +0000 Commit: Gleb Smirnoff CommitDate: 2024-04-09 00:02:00 +0000 unix: fix the ad hoc STAILQ_PREPEND() If there is nothing to prepend, don't try STAILQ_INSERT_HEAD(). Fixes: d80a97def9a1db6f07f5d2e68f7ad62b27918947 Reported-by: syzbot+bb7f3d07c79b5faf8de8@syzkaller.appspotmail.com --- sys/kern/uipc_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1b9416269696..d1f32cf3d711 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1368,7 +1368,8 @@ restart: UIPC_STREAM_SBCHECK(sb); MPASS(!(sb->sb_state & SBS_CANTRCVMORE)); /* XXXGL: STAILQ_PREPEND */ - if (STAILQ_EMPTY(&sb->sb_mbq)) + if (STAILQ_EMPTY(&sb->sb_mbq) && + control != NULL) STAILQ_INSERT_HEAD(&sb->sb_mbq, control, m_stailq); else