From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 1C5F4332EA7; Mon, 8 Jun 2026 16:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934631; cv=none; b=ef8T/sQtWikmrMqzpB6Z0AcU7uHY0NuTUmu0IPRdlg2iB5dtVhDAvBjov+QqQr6t/0qMW0/UREso/0K7xxP9CUPthgQToHoY/dDeUbsL7DwLO9+TZZJB7RzoljvUDwu1GaVGL636KG3KF6yceM5bFt6jnyMyp2o0EqsU5Fe1C44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934631; c=relaxed/simple; bh=aCdiaS58bUQL7UzePzNnvYQIC4XpFG8cK0MyqOyoThk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VqDI7xSfXSerTXtX7qGH+1ftIP6E+L0xoIHsQloeCWykpzHnlKozw25s6igWLkXh94BIj9pQwNJlrDCeov2Bof8Hpd9hwiCtwWkkKJJ903uH0WR3KP8oLDyz3U213fgirdNMi1giVaLYCxR3cn/Z3Ge/j7EYQX+x3PBUzgydDZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=pass smtp.mailfrom=queasysnail.net; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b=MFUxWWsa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dRYelcvQ; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b="MFUxWWsa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dRYelcvQ" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id C11477A00C2; Mon, 8 Jun 2026 12:03:46 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 08 Jun 2026 12:03:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=queasysnail.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1780934626; x= 1781021026; bh=zRsyJ98tISk+ATAEz4XJUroqoFu+sTEph+r90M7pkMQ=; b=M FUxWWsapxmAIkodmv5sxGWvRMBAYCE/MzQ18g7k/cV0iFFIw7eETOLLJjaX0xNWW g4ttF8Wg1ymOmeF/BHzyYJXx06rL0CTGmW0gdRESmWmOcdGSs8a0UJiWI0h+4MaV g0DfTWNT7c+QqAhIP3G7aQ1Epa/XKq/FyFwGIkYMNOG48Dwxn1eV5emHr6mz8v7i He9erul3fTcCThBX6QZKi6DDh9hkzuSY6soytT7NBsrkqIzJWTJnaNC8qea6Kn2l vGqrs2cM+EgJGFliRLPR+bG0Vkfypf2r05sDpINJS7dcnzw6rV+UG5MaBIPQ7/Q8 xP/ZjZoO3SX01qUc8YhXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1780934626; x=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9YU6qWKpqzLHTrXG6sZ5yQKMjp4qjW2VOJQdN9HKw37/kg7rQ X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jun 2026 12:03:44 -0400 (EDT) Date: Mon, 8 Jun 2026 18:03:42 +0200 From: Sabrina Dubroca To: Steffen Klassert , Zijing Yin Cc: Herbert Xu , "David S . Miller" , Eric Dumazet , Paolo Abeni , Ido Schimmel , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net v2] net: af_key: initialize alg_key_len for IPComp states Message-ID: References: <20260608144453.3553219-1-yzjaurora@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260608144453.3553219-1-yzjaurora@gmail.com> note: fixes for IPsec should go to the "ipsec" tree, not net 2026-06-08, 07:44:41 -0700, Zijing Yin wrote: > pfkey_msg2xfrm_state() handles the IPComp (SADB_X_SATYPE_IPCOMP) case by > allocating x->calg and copying only the algorithm name: > > x->calg = kmalloc_obj(*x->calg); > if (!x->calg) { > err = -ENOMEM; > goto out; > } > strcpy(x->calg->alg_name, a->name); > x->props.calgo = sa->sadb_sa_encrypt; > > Unlike the authentication (x->aalg) and encryption (x->ealg) branches of > the same function, the compression branch never initializes > calg->alg_key_len. IPComp carries no key and the allocation only > reserves sizeof(struct xfrm_algo) (i.e. no room for a key), so the field > is left containing uninitialized slab data. > > calg->alg_key_len is later used as a length by xfrm_algo_clone() when an > IPComp state is cloned during XFRM_MSG_MIGRATE: The patch looks correct, but do we want to start fixing random bugs in code that we're trying to get rid of and that nobody actually uses? If we do, then: Reviewed-by: Sabrina Dubroca -- Sabrina