Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp879935rdd; Wed, 10 Jan 2024 02:15:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsaw81EloT9X3nMfsabNmioqd8xuY9IBM0ehB92Z8Q+0ZBJhMm8X0Dq0NssjQJPtPPr5BF X-Received: by 2002:a05:6214:2a47:b0:680:cce3:d6c5 with SMTP id jf7-20020a0562142a4700b00680cce3d6c5mr3359382qvb.50.1704881704512; Wed, 10 Jan 2024 02:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704881704; cv=none; d=google.com; s=arc-20160816; b=RjeUGBMgxas7smX+K9Q8TX4gXH2rpgMIShF51ebfWtuOxtI8Yh+XikGBks3C8O3zZa P8GB1H/Ewz2plTUIeSf4kn2nAZz9TSbl+eR/nyeiV9gDV32M1klOrGpOxR8V+6+vmPC9 0PKGavoO+xVa4S5PnyKkLPyThs/nIiwNI6b0gn+zwQoIryn4YlsEnClyDCFxuFkWRLDK neQc3w4uNpd+mj9/iebFVHvs/5iF5Dxhavv0mIa2EHtUmWHUOXU1efyOmrB/lKtozwZu /M3HVQ4OAiV9g4RB2bLZ0IKenHZH37Us/l11XimrxrLCEBriASeYyvlCUHjhIjR/64I3 Q81g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :references:in-reply-to:from:organization:dkim-signature; bh=N8fyAvLcym3lieO4wYcel0i1AGhFIX/f3clpYmcSXdA=; fh=9LnugVM2CRkROhVEDcWgdq8Vjh7qCnDWTb/U3a/ejZE=; b=RnS9p8UmEurCltLl+GTLsUxc/Sd5paTXlljOuXugZ7GwPykZCKbSVSiuQB/ap1Nnv4 yxX3RpnoKFpwZYymkZ0i/mhrbN/i1r+TQhIjfmghIsAxwwz08M8aESyt/WZ81kCATPsi JbuIgs98DWJXHjBa6cQE0V9VH0F98qhOXS13rYa61xpfaYLjk3P/Xazgm2muvfDCbLeS uNu3nuSO+XwFIJo2JkPO0BvvkDe1lFyWbzECc9QmtWsUBBs6YSZv8AHV69jSBPYXlIEt 6+zHO1ps3YyNW2ex2C/MVN5bC81gl5tNznyMIzQ1RUZklpZ8V16e/rP8hDhVU9WRm/xo U7HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QW9/ez6b"; spf=pass (google.com: domain of linux-kernel+bounces-21955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21955-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y15-20020a0ce04f000000b0067f7b58a4e1si3984852qvk.212.2024.01.10.02.15.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:15:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QW9/ez6b"; spf=pass (google.com: domain of linux-kernel+bounces-21955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21955-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 7477F1C22471 for ; Wed, 10 Jan 2024 10:14:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5B283FB31; Wed, 10 Jan 2024 10:14:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QW9/ez6b" 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 AFB593FB06 for ; Wed, 10 Jan 2024 10:14:38 +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=1704881677; 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=N8fyAvLcym3lieO4wYcel0i1AGhFIX/f3clpYmcSXdA=; b=QW9/ez6bQXNcSy+gf/e8e+US/t6/PNd1zmtCi1p4RbTDmb3t775+dT8RK0YiOv6rZnaevy h7OP6XIsWb4UoPCvcDokA5Se4CwaXZ+IHmmxd+fbmWdswPKZv8HNlLiYvl8wkZsnX0qM6T 7q3GF6gkpivM0HajI/RrTZjaxljWh+E= 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-546-OvzGbcwzPAGBkz83m5jLww-1; Wed, 10 Jan 2024 05:14:33 -0500 X-MC-Unique: OvzGbcwzPAGBkz83m5jLww-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 63AC78945A7; Wed, 10 Jan 2024 10:14:32 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D79E2026D6F; Wed, 10 Jan 2024 10:14:29 +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> 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1694630.1704881668.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 10 Jan 2024 10:14:28 +0000 Message-ID: <1694631.1704881668@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Pengfei Xu wrote: > Bisected info between v6.7-rc7(keyctl05 passed) and v6.7-rc8(keyctl05 = failed) > is in attached. > = > keyctl05 failed in add_key with type "dns_resolver" syscall step tracked > by strace: > " > [pid 863107] add_key("dns_resolver", "desc", "\0\0\1\377\0", 5, KEY_SPEC= _SESSION_KEYRING > [pid 863106] <... alarm resumed>) =3D 30 > [pid 863107] <... add_key resumed>) =3D -1 EINVAL (Invalid argument) > " It should fail as the payload is actually invalid. The payload specifies = a version 1 format - and that requires a 6-byte header. The bug the patched fixes is that whilst there is a length check for the basic 3-byte header, there was no length check for the extended v1 header. > After increased the dns_res_payload to 7 bytes(6 bytes was still failed)= , The following doesn't work for you? echo -n -e '\0\0\01\xff\0\0' | keyctl padd dns_resolver desc @p David