Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2688166rdh; Sun, 26 Nov 2023 15:57:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYEPLLqSw1YysM37ru/HQd3tz+nl+ww44k2eYP3DobAN6PVxeepXI4L9N5Hum4s25B9r8u X-Received: by 2002:a05:6358:e48b:b0:16d:b449:fe9d with SMTP id by11-20020a056358e48b00b0016db449fe9dmr8706605rwb.3.1701043025099; Sun, 26 Nov 2023 15:57:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701043025; cv=none; d=google.com; s=arc-20160816; b=XDFeefPbQr8QLpJ9BBvaZpN5GCjjYZFVB6nRirAdXsWi4HWoId3FCn0Z+xHatkkZEq T62QfGxYMbdwOTBEo/upomHPYbmnVeZDdAlz3v9oTK5qOIoIhAH4yS1hBgiSQAOTCcWm JpDXyI2UcwGi8lkGTxaenhe0Pva5ENfgFjbuH4kwULG+3Tdh+uD2IlaHFEeA039qfZPF rIwUGgRHyxxshZ8yHeBK6Fq/2IJMxS+DSwdJxigjXL+ev5cRtTvCfP500MuYIsaDtPJJ aya62FUxgH2g3j8Qt4p4Zr8psMM0xmD+nSZcahuZ3EERQgaTurMQQrbnOTVKn6W4jayr eaHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=aMjUOMBsNx98bSTGJ5OT6pqeZWF3+KxX6/PMEtjSuY8=; fh=zCwlz2EzHSInifeuhjMNbnzeTRB9Zg9MYDYFGrMvPTk=; b=gY4RaRE+vL+8vUzy8hBgnuWwt6NdbOsAIY2MOpsYtzA/1mnOXFSHTU+ijdEL4ageVg NnEmPi7OkN27XRrmqqtSrCFzMhFMw09iGtnCi77fDgA49zEan53KhOPcTmq7kQwIiGEB GbT0rOc0MLDPQhNFhq8pHEqIP4z1y/qUIg3Hr7oY5BX35oY7niI2+7O87JOalSJIAzr3 /PJ3N+SwMpboV7Dmr/ZLuUhmI/J7iiXAdErZJA87FHIpiRo61BRP0g9sNycClcsImB06 Quh6t5gpd03CFYpaJrThxW318mRRymrXoxHApTTfusCtlk9niuUGfoQk0iQtToAc4+MR RiLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EUdtwVos; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a22-20020ac85b96000000b0041cbac106cesi8339087qta.684.2023.11.26.15.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 15:57:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EUdtwVos; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C5193805C3CA; Sun, 26 Nov 2023 15:57:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjKZX4o (ORCPT + 99 others); Sun, 26 Nov 2023 18:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjKZX4n (ORCPT ); Sun, 26 Nov 2023 18:56:43 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED2CFB; Sun, 26 Nov 2023 15:56:50 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-285741e9a9aso2113662a91.3; Sun, 26 Nov 2023 15:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701043010; x=1701647810; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=aMjUOMBsNx98bSTGJ5OT6pqeZWF3+KxX6/PMEtjSuY8=; b=EUdtwVosBaGw+we1I7/f4LYOZ5kn0owCMsQsyv4tMisf4fwTuSsf2HipeIuLJS+a2Y qGgqs0LRPxdYVQeLp8rTbUYoYDeqO/nhLJqwNkpssZ0KOmLPTUTRzu2iEo+bnu3rnvHF 1f942ytOQe9k0n09KrNt8oWMh9w50T/0/AfqOmF5xx95xS+CCZ1M62tsKZdJbBXjXmT8 gy50ZBFFE/USRJzdbjCQSJiRzmHc7vec5sqJwyvGe0fG4Y29nZbu1N3cLkv5EGTOPh8T zEigXXcwEs7U7xKeBI3xRabBhP6+MtdhzybPNPP+WUgPSeblJOH04CMym8Vn2jb3K9aU N/8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701043010; x=1701647810; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=aMjUOMBsNx98bSTGJ5OT6pqeZWF3+KxX6/PMEtjSuY8=; b=iS1iaw0j3R8tX1/hxpBH6vWsiSnogDA4ZnzgtpFKSI5j3xrUVdX6JhmR3oaaKgmCWz Rs78kl56eQeNAni6fBxJSiEJVWCrGCmGchH2erb+XdL1OJ4/408XlbY6U6KXBhHCOGUg lyqN3N0WNgZHA6z2rtsCE0NT/RCXWuqNQ+C90RckUJDU61NaHjrnWOSAF9j5pA8EBQQD IR6YRN15b7tUt/SNn10nExNTALNuqnEU5KfYV6tu5zPtkE1ZlItfjEWi7xVpMJxs7apK GdCJyK7c/OKbOC/V5i6f0TH3qCnTsFD7uv7VenmYFuSVCA/LMhyOKjhSOPdTXZ53gmi3 rlYA== X-Gm-Message-State: AOJu0YzWdYQbtCVMytYajYtYUgNXwPNiNOaewfz+tkLcTivyQXF9bXXV TCl/j40xrNu6CjDsDOhxZ9s= X-Received: by 2002:a17:90b:4c41:b0:285:9a34:5b40 with SMTP id np1-20020a17090b4c4100b002859a345b40mr5740305pjb.40.1701043009832; Sun, 26 Nov 2023 15:56:49 -0800 (PST) Received: from localhost ([98.97.116.126]) by smtp.gmail.com with ESMTPSA id ij30-20020a170902ab5e00b001cc3a6813f8sm7082451plb.154.2023.11.26.15.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 15:56:48 -0800 (PST) Date: Sun, 26 Nov 2023 15:56:46 -0800 From: John Fastabend To: Jann Horn , Boris Pismenny , John Fastabend , Jakub Kicinski , "David S. Miller" Cc: David Howells , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <6563db3e1d1ef_68d9b208cf@john.notmuch> In-Reply-To: References: <20231122214447.675768-1-jannh@google.com> Subject: Re: [PATCH net] tls: fix NULL deref on tls_sw_splice_eof() with empty record Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 26 Nov 2023 15:57:02 -0800 (PST) Jann Horn wrote: > On Wed, Nov 22, 2023 at 10:44=E2=80=AFPM Jann Horn w= rote: > > syzkaller discovered that if tls_sw_splice_eof() is executed as part = of > > sendfile() when the plaintext/ciphertext sk_msg are empty, the send p= ath > > gets confused because the empty ciphertext buffer does not have enoug= h > > space for the encryption overhead. This causes tls_push_record() to g= o on > > the `split =3D true` path (which is only supposed to be used when int= eracting > > with an attached BPF program), and then get further confused and hit = the > > tls_merge_open_record() path, which then assumes that there must be a= t > > least one populated buffer element, leading to a NULL deref. > = > Ah, and in case you're looking for the corresponding syzkaller report, > you can find that at > . I'm a bit slow, but looks good to me as well. Thanks a lot. Acked-by: John Fastabend =