From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (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 50EFC41B355 for ; Wed, 6 May 2026 17:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778088034; cv=none; b=MS4v6RuL9/kvnmrN8sp/CPTZ0Y9vnmx/Byh6QMo+1rSozlnteEebwr0fGMbRpLeNgcdl234w3vzGhiOjlXtWKQG6Lp37+LgQJclDoIdaqUYPaBSVzBsRqiz31L/IzaX8NUWmqXIcxvmH82MoiaZvllxMJkh5SNpSwl2mVS47ZXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778088034; c=relaxed/simple; bh=xAAgnYgLlSXFxR0cxBA1qh6iw/0Tn3Xeue9/SbE/mwU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D8zcfk1BHqL9m0Y7xesPg3AVZffTeWOLnO+Z+h+QX9+xPXyo/85OY0CKYL/YRuR6GzGfFHxdSwGB5cG4QTXK0nKlNw9oFvOOZNlYzee9J6+80v3k/h3/jlsgZXIheY42YRpFHKe6To/wRJHs8RhKBcdTehy727ZYfa6e2krki7s= 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=cSHvfrm+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=BSyfcY2o; arc=none smtp.client-ip=103.168.172.146 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="cSHvfrm+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="BSyfcY2o" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 0EE04EC0128; Wed, 6 May 2026 13:20:25 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 06 May 2026 13:20:25 -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=fm1; t=1778088025; x= 1778174425; bh=qivrMLBxM/dU85KxqKwVVx87J+0cqXSf/AT00ICCzu0=; b=c SHvfrm+lgh7CQys39c6YiPiX9dVWo4OryGKDGlRUNm7SnvudrXejg8IjtkUdukrA OQFOlHS/O354EFe80X9Z2tT3OJsbvCmIEy8M3PsOr8Fs5T0DzNehu9hNWptKy/jr pjbQ0lPJpuwHmKCvFRUdj85JWW4ZdVT/do0oY9bW2s4zptyXbXftaP5pbLFJscmM XE/MX+eXs/6FQ7k8HDW9q7quQKuWZKigHJX+atHqa/M3q+byGXawnNUaFtIcvPbL sbY4/0vbQZw0TZO9s8PoeB3PSFAnqJqV1/qwF4WmZMgjKShFoeoYFmbzT8pCobMr bXzdWVzjRP3eXnX2KFMug== 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=fm3; t= 1778088025; x=1778174425; bh=qivrMLBxM/dU85KxqKwVVx87J+0cqXSf/AT 00ICCzu0=; b=BSyfcY2ows4dNBLgGjUfzQsON9KzYB8fz6oA8c+LJIkRfZOzfqC YGFh+VxxOCpKC5zNajM3Gi9wukEopP5aEz+HWsvLXJGe+Y5moF7suSi+vkoTqi01 E+IhtmOMat50m/s6voF9FsDY+ILZD7qBX/qAUwViTPy2lyB6H/uoZoDWckj6O8ah 6P5jaXmMgijD2UcgEXqSxKiVetHJcjbbU5tFIerY++myE4QieZhWlLl1FDL62obr /fnynwOKzrkXEFOijeyoFy3Q2Qfk/HDboocpUX+UBBkH3D4l2L6rdYRTD1XBa+fU /iLj74JpltcdE7q8C4oOKklLBufeu6oc6MQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddutdehudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtjeenucfhrhhomhepufgrsghrihhn rgcuffhusghrohgtrgcuoehsugesqhhuvggrshihshhnrghilhdrnhgvtheqnecuggftrf grthhtvghrnhepuefhhfffgfffhfefueeiudegtdefhfekgeetheegheeifffguedvueff fefgudffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgusehquhgvrghshihsnhgrihhlrdhnvghtpdhnsggprhgtphhtthhopeefpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehsthgvfhhfvghnrdhklhgrshhsvghrthessh gvtghunhgvthdrtghomhdprhgtphhtthhopehnvghtuggvvhesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopeguvghvvghlsehlihhnuhigqdhiphhsvggtrdhorhhg X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 May 2026 13:20:23 -0400 (EDT) Date: Wed, 6 May 2026 19:20:22 +0200 From: Sabrina Dubroca To: Steffen Klassert Cc: netdev@vger.kernel.org, devel@linux-ipsec.org Subject: Re: [PATCH ipsec-next] xfrm: Use regular error handling instead of BUG_ON() in the netlink API. Message-ID: References: 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: 2026-05-06, 18:08:55 +0200, Steffen Klassert wrote: > The xfrm netlink API uses BUG_ON() on failures since it exists. > However all these error are uncritical and can be handled > with regular error handling. This fixes machine crashes > in situations where an emergency break is not needed. Nice clean up! [...] > @@ -1794,7 +1797,11 @@ static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, > return -ENOMEM; > > err = build_sadinfo(r_skb, net, sportid, seq, *flags); > - BUG_ON(err < 0); > + if (err < 0) { > + kfree_skb(r_skb); > + return err; > + } > + nit: extra blank line > > return nlmsg_unicast(xfrm_net_nlsk(net, skb), r_skb, sportid); > } [...] > @@ -4151,7 +4170,8 @@ static int xfrm_send_report(struct net *net, u8 proto, > return -ENOMEM; > > err = build_report(skb, proto, sel, addr); > - BUG_ON(err < 0); > + if (err < 0) > + return err; This one is missing the kfree_skb(skb). > > return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_REPORT); > } -- Sabrina