Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp68547lqo; Wed, 15 May 2024 22:03:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmd3W5utJNYAaR6QCeidzLPokqacVrocF1oPm3M0osjYxMB8o7ntwMukdsEfUcAo8rXq941ttwxje81GBG76BjesganyniLeGidKLMKA== X-Google-Smtp-Source: AGHT+IFoOJfMFL1hO7cm36LQdh595ToIuRWOZ5AJ34Qpm7fMIUWF58GHr/WLWO8mKkcN/WxH7Qka X-Received: by 2002:aa7:d612:0:b0:573:507e:80cb with SMTP id 4fb4d7f45d1cf-573507e80f5mr10891129a12.0.1715835831901; Wed, 15 May 2024 22:03:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715835831; cv=pass; d=google.com; s=arc-20160816; b=VZyeKBcelq0G88vE1gfELdP0BbCQdDtkY07Nzw4LGh5rBBc5+RsXKoyZea/XEpExW3 /u9iQusn5Z99pSzXeGmXfhk9DoVUVdPlFspa0hSZobv3Qv9y6+8BHd0SC5/2UgdwLCrB 9jx7BBgHBGDq1Y07/+dKYKq01DDJYLEcWrdm+rNjkGUb8QCfw9DKAyV2f4rzlyKBuwdP xyQJgmNYUAWET3UKyjXKkIEIBdqFnwVMSmf0tt8P2eq8KcUrQleDCIhvia2r+N4iwXEw yxNOTlND+/V5eB9JC8ed9tYfRPCnnmuOKSJsuq+/drjpIxHaNKE11D509bbpE67l/zYZ HnKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=BIdlxCtNUsN14oiOu6iayNNOeSqk/xL+5C1diPVIWj8=; fh=JsyfIUdjzIJLLB/C4ij7qxHes8jTOQdTosmhayxqybk=; b=kgUzEgNyzOn7WVqBoqYiW9Cg4hGWOqDS9VB6jXMOYEGun3Odus81NRzdqkxIUB3sOG jnzYuSjfGem1nceJOh/wT7lfsMMw8E527yv+LhKDD4mS+dyvudhJUPzu41Qi9O3+Mm1i IzWrp58qAIVE4SxOIvQ008FuIk7ONP46w42MCZG3OdnU7FInAVIDjh3czFomDz4OZntF yQ4b5WsLlriiLOq4uqj1hmO/bjZ+Ds+aee+Nt4YC43g/CufovJRonFDfsTkzWbUtrNqJ dX6a7PBUM2f3epuV3I2xSsePU/bAI8k68PuQL0GyIFITVjnQAxiSwmQ4JbINLIx15xLR BaiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h1dD+Dao; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-180648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574f7c0bac1si1612408a12.69.2024.05.15.22.03.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 22:03:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h1dD+Dao; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-180648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7AFDE1F24135 for ; Thu, 16 May 2024 05:03:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06A731B7E4; Thu, 16 May 2024 05:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h1dD+Dao" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6872E10A23 for ; Thu, 16 May 2024 05:03:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715835820; cv=none; b=Z6qVAzDZoaf6YFw1oE5hvrRKTggczIIjZ1PhkPHSStURZmLmo+qVdJJKnU8xTpxVbIystv/cmRguw4Q81A11VC/z8TKxCBVLUCJ3BzHhR7rsX0cDF98wjk82z2G/K010e3lmGrpyP1LdusyMOamb9M0uAuGFhCgkLQaaUfDA00Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715835820; c=relaxed/simple; bh=DjF0gKWJ8+yHQMlYXKXU86iXdSe/PU926z1Ys3/Duiw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JDVnopuwmGD3hwvmB+Iki1hi06mJ2E9cHjoWR5clK+sgi7lY+GOaR7w7ZM4UY+3xzxgIa7PZWx+7rZIwdj2O6adBW4P/Qs2g85ZG124JvASlJBl+9DWcv+7J2KUbB0RybporanoM8groj6I0fPMptZqUENTcApdoKxts2vkNILY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h1dD+Dao; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715835817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BIdlxCtNUsN14oiOu6iayNNOeSqk/xL+5C1diPVIWj8=; b=h1dD+Daog574QsulTvpjvB4BWR08WfD4rReYTO9SWY7VZatn2suzFwj81QBrNUXIxecMZW TooWaC2ftPtS4iVwKbufUb89bRcnmc5KBOUzTv/g7slk11OxuVVfVhuRtK9aSRVGN6fSt/ sIpgJ5mO3dUa3waKWiWsKxiJKvTPfVg= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-p57CLT3cOYG9DW3Bqbx7JQ-1; Thu, 16 May 2024 01:03:35 -0400 X-MC-Unique: p57CLT3cOYG9DW3Bqbx7JQ-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2b33cce8cfaso7441673a91.3 for ; Wed, 15 May 2024 22:03:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715835814; x=1716440614; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BIdlxCtNUsN14oiOu6iayNNOeSqk/xL+5C1diPVIWj8=; b=okAdKzmtqFDTp2agaaORHlGIjziiF6YGRC21cl+8OxReRIvkJf4Qsa7aPa2sD/MSad +yv3W19aS7kQl6QzCoppLdpSRaZG13ylZ95zU21mF+AEoQ2319gjqgObtFHXMS4qfChb scSL/2IbWg8QGa+W5DdUDnCsfDaujAV2MMCGY1gyEeY8loHjXZMLkZTbnE9cdPrpHZ+w R5Vx/0ospO33fE5Q0tR7GqrPDRRqm/3dLaIgwdWcTACQsUeQgKDRWVngKuQFFwuwEYm/ fKhxHSw0gcLU0KCpPgwMdo3+cwDsIDFidwoQABumDPoHtFTxdQGQXP+OCdPpnV5D2bsv fE0Q== X-Gm-Message-State: AOJu0YzS3S+Oi+aGVIeOdjv07okwK0An3i6QuAcZNpLGb1ggyBomT1in uWcFxLNRNEu3TfkaT6o6fft0FAymgndWsBZikchisHJeXFET58tW2C1Z3CEm9hF9uh1wprUgBr4 ztha+lb9iQc4FkXL/h+HIThroSfn6lt7co9vtnnk3MqO8UvkiImGIgoHRopIrBNzEO7z9Byi2Mn czR2N+6+8Alp6FXkCEQP/+LwE2eRfKPoV65XHI X-Received: by 2002:a17:90a:dc82:b0:2b5:6e92:1096 with SMTP id 98e67ed59e1d1-2b6cc87abadmr17615797a91.28.1715835814625; Wed, 15 May 2024 22:03:34 -0700 (PDT) X-Received: by 2002:a17:90a:dc82:b0:2b5:6e92:1096 with SMTP id 98e67ed59e1d1-2b6cc87abadmr17615782a91.28.1715835814295; Wed, 15 May 2024 22:03:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Jason Wang Date: Thu, 16 May 2024 13:03:23 +0800 Message-ID: Subject: Re: [PATCH] vhost/vsock: always initialize seqpacket_allow To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, syzbot+6c21aeb59d0e82eb2782@syzkaller.appspotmail.com, Jeongjun Park , Arseny Krasnov , "David S . Miller" , Stefan Hajnoczi , Stefano Garzarella , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 11:05=E2=80=AFPM Michael S. Tsirkin wrote: > > There are two issues around seqpacket_allow: > 1. seqpacket_allow is not initialized when socket is > created. Thus if features are never set, it will be > read uninitialized. > 2. if VIRTIO_VSOCK_F_SEQPACKET is set and then cleared, > then seqpacket_allow will not be cleared appropriately > (existing apps I know about don't usually do this but > it's legal and there's no way to be sure no one relies > on this). > > To fix: > - initialize seqpacket_allow after allocation > - set it unconditionally in set_features > > Reported-by: syzbot+6c21aeb59d0e82eb2782@syzkaller.appspotmail.com > Reported-by: Jeongjun Park > Fixes: ced7b713711f ("vhost/vsock: support SEQPACKET for transport"). > Cc: Arseny Krasnov > Cc: David S. Miller > Cc: Stefan Hajnoczi > Signed-off-by: Michael S. Tsirkin > Acked-by: Arseniy Krasnov > Tested-by: Arseniy Krasnov > Acked-by: Jason Wang Thanks