From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F171F3A6B7E for ; Mon, 4 May 2026 10:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777891527; cv=none; b=NyU6O38ElZg89Nc05jk9Oyzg5nlV+bVJM9HhrtM/36HKi0on5dp61Y3IXh4X4DtxJMEKctsv209DaSQ53SVtPgiCM6LFgIA0WYQX2h+mKHM4Gb5NxT8nh28TtqFT1QCbSnGte+iK/ik/X+pWop5VY6/cLRL4MibNlv7QaWRBHg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777891527; c=relaxed/simple; bh=9v4I0rrhjr02/PfB8x9dXyidG3msYuPLuRZKE3wmILQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=n6QgpA3pfIApIfKvW5EvQf5zdU3bUZYxgY8GH7hFht8lH7TckdAo34N+yGgCYaFmXBsT8cNwCpzdMYnpYMcGqwIRXgz3qicSWgfOLsN5ksJok2l1ywTtC0ml8xRjHODLj+WKSgDZ749NRqbyPOpWI/Gn+WqBlcMYpMlU8I+a2+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ojyvViIX; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ojyvViIX" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-44a71109b94so2165431f8f.3 for ; Mon, 04 May 2026 03:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777891524; x=1778496324; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=9v4I0rrhjr02/PfB8x9dXyidG3msYuPLuRZKE3wmILQ=; b=ojyvViIXfccBVR3KvSvCPXt9CocsRP0LR2fFVrxJk+TnqLHouXTKuInwVByMmT54O5 zf6Od+TLhHw5oJRiDYE7sBWOP0R1QqWwU3E1gd/gN/IyIsrQ509Ng1CfdiyQJFnR7Tit g3tqCzQS4qwMoy8yEfg8LZnBXSUylhspzLi4b/CMuuDbpmrjY38nD3pW7GakUh0O+wWo fiodNWKJ66/59IAR0cCSIR2TQywgwh+vhsGO104OqdL/gOv6/wzu7111nMpZ4Jv2Q2uJ hbZzlsw8+9Zy6BHO3E3Gh9qCL6N5LuH9AC3z28dhgv/QRIQ/8fgOsU0oVX8lGx6X5hHL cJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777891524; x=1778496324; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=9v4I0rrhjr02/PfB8x9dXyidG3msYuPLuRZKE3wmILQ=; b=HXZRemlsUv/xT81yqz/LjEXbQgguT66BGVZOP6SMlRvRw3k9ZBybSFOeStL99lZAIC UzfMPxZPSUEDGd/OhA/QGT9xNyPQWKY6kxe6utzqyr73G2g3l7Or3Fz+L3acWvBqcWGl STcOEuvyy4c2j2SQCGxAGdvlBZ19hdhTgYXTo4BnE0ejk8Dzg2K9lAewb58IZW4Eq8BV Sn9g0/fDgmptHX5x4imF1XPfMlu5AnKeZ9gCjCvdL83U52v7nhyPYv2QtucF+BvcUlO7 jNcV5bNm0lU5UvG9XHZ8QW1O2ZWYqf8M8RSrA9bfsfhrXezW+1pCHAe4hwpwvGHKNNO1 sOog== X-Forwarded-Encrypted: i=1; AFNElJ+fKpYoCCzifqPxTtXP8SPrvjupl5Q7oJK8XdWxZb1zpjmJXlf2yf2or99GoPdpJpQ22eFZ0xh1uTOKCDE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5LcbH4nDLZMVqNw2B9WaXFZ1i0pow0eU4wGre9cesbYcdHYSg rsMIHdKURdYO9N++0Q/zDcdFQ9/ZsUrwqPtns7st0FEntJ78KJFGRQIY8zCtY8KhWSYhnHOee5Z DEb9b3W7DokfXU2J7JQ== X-Received: from wmxb3-n1.prod.google.com ([2002:a05:600d:8443:10b0:485:3aa2:da59]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3f14:b0:488:f453:b976 with SMTP id 5b1f17b1804b1-48a98675809mr164982575e9.27.1777891524379; Mon, 04 May 2026 03:45:24 -0700 (PDT) Date: Mon, 4 May 2026 10:45:22 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260504-genlmsg-return-v1-1-093f3ba970af@google.com> Message-ID: Subject: Re: [PATCH] genetlink: free the skb on 'group >= family->n_mcgrps' From: Alice Ryhl To: Eric Dumazet Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Matthew Maurer , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, May 04, 2026 at 03:20:25AM -0700, Eric Dumazet wrote: > On Mon, May 4, 2026 at 2:17=E2=80=AFAM Alice Ryhl = wrote: > > > > These methods generally consume ownership of the provided skb, so even > > if an error path is encountered, the skb is freed. This is because the > > very first thing they do after some initial setup is to unconditionally > > consume the skb via consume_skb(skb). Any subsequent errors lead to the > > core netlink layer freeing the skb. > > > > However, there is one check that occurs before ownership is passed, > > which is the check for the group index. So if this error condition is > > encountered, then the skb is leaked. This error condition is generally > > considered a violation of the netlink API, so it's not expected to occu= r > > under normal circumstances. For the same reason, no callers check for > > this error condition, and no callers need to be adjusted. However, we > > should still follow the same ownership semantics of the rest of the > > function. Thus, free the skb in this codepath. > > > > Assisted-by: Antigravity:gemini > > Suggested-by: Andrew Lunn > > Suggested-by: Matthew Maurer > > Link: https://lore.kernel.org/r/845b36ba-7b3a-41f2-acb2-b284f253e2ca@lu= nn.ch > > Signed-off-by: Alice Ryhl >=20 > 1) This looks like a fix meant for net tree ? >=20 > 2) We require a Fixes: tag for bug fixes. >=20 > For more details I highly recommend reading at least the tl;dr part of: >=20 > Documentation/process/maintainer-netdev.rst Sorry I forgot that the net subsystem has special rules. I do not believe any callers actually excercise this codepath, but I will add a Fixes: tag and indicate 'net' tree for the next version in a few days. Alice