Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1129693rdd; Wed, 10 Jan 2024 09:25:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+WKns/ZQ225OL5cwoZhG5VEBafQV4hwaAjpXzt/gXo4AF0GZjh2PE6XT3IcCBJkZs5zo2 X-Received: by 2002:a05:6214:21ea:b0:680:3ac:2415 with SMTP id p10-20020a05621421ea00b0068003ac2415mr1608749qvj.120.1704907508033; Wed, 10 Jan 2024 09:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704907508; cv=none; d=google.com; s=arc-20160816; b=HxeIScaj9PBETEQq/MjOSPOIehBQTgPdVuuJIip7W3LAD0y/2dAiuHtCcGt/ILdDOB vZULAebuZTxz+PIv1YAElM64kWsO7oH/WCZt/mXKxx3zsjANewqWmW6AGnvIWjppfbPy No6yIs9qd9SrEGcPEcUlwIRIn89nEhPn6zJCG7OTDFCFNQVnY6t+Y46FkMk8A+wOf3yU fuVJeVPiN0fGJBPUe85Hv5/1WkU9P2PjUWnjToBZKQ0VIPvIvYaDLZb66F5r1JHtQTyF jhlbdLqEoBZVIoK0KhusN8dPqyoaWYEAqVAdacLArqxbsnjzaVl0Vu43PJiSZkddGSwN CNmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:cc:to:references :in-reply-to:from:organization:dkim-signature; bh=jocqRgtMadaCQwvnSiqn2EsI9KXVShv2lHTrjFxLh1M=; fh=InRxCumHi2HlGPAQEITJffBy3kF64T014rds+PhWTh0=; b=NDThQq48D62s1vvvc6QE4+Ybcpz1IadP2vR+D8RM5P3DYGvFoG1dt0E61ji/SIydbm dYp7TqAQJXpxeImofgdMbx56DGRqcppo62yMIucl/JaudVT7V16lIg7jJeS+gR5LSkAp fu5xVB7S3YCMOrIF1M/9JNEGgPdZGe3uWdSctoSfGXdDE2ViomwNsEBl4hsXiaMgogH8 /O8+a1IZx4c2xL4s9hadftb5DFLBi9RAY0R4BkPmVkh2p3rVL0GS/4FDeokZsGZrkQq2 uJfwutR7evBfrDbLbUyndtnQUG+TJOruWVtvhmAOH8H7nbfxIkgBgY4NGmmphhnRAJMC n0SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZMPgzC1y; spf=pass (google.com: domain of linux-nfs+bounces-1013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r6-20020a0ccc06000000b0067f7ad0c946si4805287qvk.251.2024.01.10.09.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZMPgzC1y; spf=pass (google.com: domain of linux-nfs+bounces-1013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1013-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B7D2D1C22A44 for ; Wed, 10 Jan 2024 17:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00FE14CE12; Wed, 10 Jan 2024 17:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZMPgzC1y" X-Original-To: linux-nfs@vger.kernel.org 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 8FFAA4EB4B for ; Wed, 10 Jan 2024 17:23:42 +0000 (UTC) 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=1704907421; 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: in-reply-to:in-reply-to:references:references; bh=jocqRgtMadaCQwvnSiqn2EsI9KXVShv2lHTrjFxLh1M=; b=ZMPgzC1yoWQKf4MH7RO2J0gvt/Zy+L63UJoALDp6+UdzHBD1jSGTkKovCnFQVVUS7LmHWq 0VcmGgC3nJzZ9z3uhL9UQNezl3Kw+XV0wJe7KlcOlzzChmZegofYkgMrLGKBvktj5dnz4a 1AW5Xbt7KZus0EQA1JlDWLaRgjNUmew= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-cbBMg0BXOm21eCxa6xC7xg-1; Wed, 10 Jan 2024 12:23:38 -0500 X-MC-Unique: cbBMg0BXOm21eCxa6xC7xg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C547688CC43; Wed, 10 Jan 2024 17:23:36 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 914741C060AF; Wed, 10 Jan 2024 17:23:33 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <1843374.1703172614@warthog.procyon.org.uk> <20231223172858.GI201037@kernel.org> <2592945.1703376169@warthog.procyon.org.uk> <1694631.1704881668@warthog.procyon.org.uk> To: Pengfei Xu Cc: dhowells@redhat.com, eadavis@qq.com, Linus Torvalds , "Simon Horman" , Markus Suvanto , "Jeffrey E Altman" , Marc Dionne , "Wang Lei" , Jeff Layton , Steve French , Jarkko Sakkinen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, keyrings@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, heng.su@intel.com Subject: Re: [PATCH] keys, dns: Fix missing size check of V1 server-list header Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1784440.1704907412.1@warthog.procyon.org.uk> Date: Wed, 10 Jan 2024 17:23:32 +0000 Message-ID: <1784441.1704907412@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Meh. Does the attached fix it for you? David --- diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c index f18ca02aa95a..c42ddd85ff1f 100644 --- a/net/dns_resolver/dns_key.c +++ b/net/dns_resolver/dns_key.c @@ -104,7 +104,7 @@ dns_resolver_preparse(struct key_preparsed_payload *prep) const struct dns_server_list_v1_header *v1; /* It may be a server list. */ - if (datalen <= sizeof(*v1)) + if (datalen < sizeof(*v1)) return -EINVAL; v1 = (const struct dns_server_list_v1_header *)data;