Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2025 13:51:05 -0300
From:      Renato Botelho <garga@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 82d8a5029a80 - main - unix/stream: fix instant panic w/o INVARIANTS
Message-ID:  <76f53310-ac59-44cf-a991-077defee502d@FreeBSD.org>
In-Reply-To: <202511141604.5AEG4mNt027362@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

On 14/11/25 13:04, Gleb Smirnoff wrote:
> The branch main has been updated by glebius:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=82d8a5029a80a77166dca098b8fedb10d84e4e38
> 
> commit 82d8a5029a80a77166dca098b8fedb10d84e4e38
> Author:     Gleb Smirnoff <glebius@FreeBSD.org>
> AuthorDate: 2025-11-14 16:01:47 +0000
> Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
> CommitDate: 2025-11-14 16:01:47 +0000
> 
>      unix/stream: fix instant panic w/o INVARIANTS
>      
>      A stupid microoptimization I made leaving empty STAILQ inconsistent
>      is a brainfart that is related to much earlier version of this code,
>      where it was safe to do so.
>      
>      Pointy hat to:  glebius
>      Fixes:          69f61cee2efb1eec0640ca7de9b2d51599569a5d
> ---
>   sys/kern/uipc_usrreq.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
> index b1cb6de98b5b..6996f3d447bd 100644
> --- a/sys/kern/uipc_usrreq.c
> +++ b/sys/kern/uipc_usrreq.c
> @@ -1492,11 +1492,10 @@ restart:
>   	}
>   
>   	if (!peek) {
> -		STAILQ_FIRST(&sb->uxst_mbq) = next;
> -#ifdef INVARIANTS
>   		if (next == NULL)
>   			STAILQ_INIT(&sb->uxst_mbq);
> -#endif
> +		else
> +			STAILQ_FIRST(&sb->uxst_mbq) = next;
>   		MPASS(sb->sb_acc >= datalen);
>   		sb->sb_acc -= datalen;
>   		sb->sb_ccc -= datalen;
It fixed the crash I reported earlier.

Thanks!
-- 
Renato Botelho



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?76f53310-ac59-44cf-a991-077defee502d>