From nobody Sat Apr 27 03:01:13 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:1d48:0:0:0:0:0 with SMTP id 69csp1255023jaj; Thu, 16 Sep 2021 09:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/ZrZKENwlPEn8PNac5cRS/2YT6awv1ZAwd+dKfr9+cVgrQhvQ8Ut2IsDUF5lQEtiWhYJP X-Received: by 2002:a17:90a:7d03:: with SMTP id g3mr6893143pjl.242.1631808406634; Thu, 16 Sep 2021 09:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631808406; cv=none; d=google.com; s=arc-20160816; b=KuMihNMrMyAtbhqhmH/n7+UJSirb1mXPI8z2XYnx3bQJGUBt42b6x7jEqqB4bNPTpI zIrj4skdImyICp1yCFufVM8gCVsTsUgN7hOG3jjn4jsm0fmDTIX3IpJLeMaVnigdiCtV iAGsMpblKYfxtj/43/dNx/FEUZjcz46ymoZfhtnM9FoZLUqKMHyNS9q4HjSsKveQNmak Mg/eAW2D/FLn0o5LZb82uZbg/o00QzmEGwbbaTCr42i6OUOaMfcl4l86lp2kiF064GjO Kp7l3tClsrcso7PxXzJQ3bt4kk0+MxwjEHnj2ipPzyrsmCeCtKTHAgqTtsP0e1xrz8Nz IBKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=bEuaXyfQOu5u/+JCvqbiBHcW8UFLuVxbyVMngmczWMs=; b=x79eH1U5OF2XaBJy7AtHjLzyLaHFbxr9lhZ0drLRJjaAwhJSn7zS7wqRqaYoEmNoFC Yq8SxT8ysSpAREJGl7hAuw2WxCxq+KmuW7ug2qi10p2tIiuOnXPgBWID/0LhjPgD54pT jwLt7DPaC61WPb87vOe2X6Um2tAU9O1GkrcwZr5ZT9mbcijmwW4RTAdbq/PdjzUYIXRJ HYtkrOlmo0YFjcpD3gDoI4U+sFclSyDhv78J1zpfXmFmOViq/TvndNlYIxEGQp+i6ypL lySNZU+NKy+ci4viQuuyGP63X4XUYyI8aif8a5L0iM8+RfiBeYItS9DD+QunOuVjNJHg tBPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="L1V/VE3N"; spf=pass (google.com: domain of mptcp+bounces-1942-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1942-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id g1si9908995pjc.168.2021.09.16.09.06.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Sep 2021 09:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-1942-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="L1V/VE3N"; spf=pass (google.com: domain of mptcp+bounces-1942-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1942-wpasupplicant.patchew=gmail.com@lists.linux.dev"; 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 sjc.edge.kernel.org (Postfix) with ESMTPS id 0B4563E1058 for ; Thu, 16 Sep 2021 16:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 054B62FAE; Thu, 16 Sep 2021 16:06:45 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev 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 ADB833FC3 for ; Thu, 16 Sep 2021 16:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631808402; 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=bEuaXyfQOu5u/+JCvqbiBHcW8UFLuVxbyVMngmczWMs=; b=L1V/VE3NlnUqBXyzu0xIVMz+RL+xX605G82rgl95PBvpwnIgu78oYOt9RazX/LAWc4yNUk K9/sweKtwbVP0r1x+ltFcSmbcohAeNGNkP+XYOqYyIKR6MX1V8fQjNNBRzz3jWpTDAPpG3 8Hw/LYevOts8OTh/I7H7BMr9rraoSi8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-ZZSo5O48PTWBQxSjiLJHsQ-1; Thu, 16 Sep 2021 12:06:41 -0400 X-MC-Unique: ZZSo5O48PTWBQxSjiLJHsQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5D6D800FF4 for ; Thu, 16 Sep 2021 16:06:40 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.193.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15BD35C1CF for ; Thu, 16 Sep 2021 16:06:39 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net] mptcp: always provide MPTCP skb ext for tx skb Date: Thu, 16 Sep 2021 18:06:15 +0200 Message-Id: <0bcf04149918792f287bf56fb5a38e4a19be4fe0.1631808364.git.pabeni@redhat.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pabeni@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The mptcp code will uses whatever skb is present into ssk->sk_tx_skb_cache. If the skb tx cache is enabled, the recycle operation will clean the MPTCP extension from the cached skb, and the MPTCP would hit a later WARN. Fix the issue always invoking the mptcp skb allocation helper, which will safely check the cached skb for the extension presence. Fixes: 1094c6fe7280 ("mptcp: fix possible divide by zero") Signed-off-by: Paolo Abeni Reported-by: syzbot+263a248eec3e875baa7b@syzkaller.appspotmail.com Reviewed-by: Mat Martineau --- net/mptcp/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2602f1386160..f0673541a764 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1325,7 +1325,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct= sock *ssk, } =20 alloc_skb: - if (!must_collapse && !ssk->sk_tx_skb_cache && + if (!must_collapse && !mptcp_alloc_tx_skb(sk, ssk, info->data_lock_held)) return 0; =20 --=20 2.26.3