From nobody Sat Jan 11 22:21:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVtKW1nDVz5jtmV; Sat, 11 Jan 2025 22:21:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVtKV5nN7z4RBp; Sat, 11 Jan 2025 22:21:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7b6eeff1fdfso278170285a.2; Sat, 11 Jan 2025 14:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736634092; x=1737238892; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=0h5bZ9lKUABuOTFdJa/9lU1dYLtE7EIgoyNt31GiAwc=; b=E14aBUWaS4f59+/laca2DeuB/Nteoi4HB4dPS9zfzmOJlzwldhOXptTAtkuKao9sfv mclC0F6GtxOAC5F2xMI32SeKjLyUV2eGroD9feoJ1R79K0KNKro8FeUFGeNmsXK7mmWL 788CIbdNpsrlQOFASiACzql2cUHqpsmn+E06mgC36dMfKWd9Bk25ofoZD7p97e2A5cU8 g84RReTAh3lHMNCCD8ChkR5KtbTJrytHW8e0miCJKPthQwT9OmKbnFTb+auZ28UxAOx0 EhfTkt3T2v5awqJnSeL2q6T8rZcc33BwTFiiFu2MPH6TEbdGGf9EB1ASDJvUbosZzcJp 3zYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736634092; x=1737238892; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0h5bZ9lKUABuOTFdJa/9lU1dYLtE7EIgoyNt31GiAwc=; b=pFpLg6UpcaatnSuIDkuBn1eUpCUEupKPwaxXfjU74Kg9qycIuKBWt0m/y0EPbAIklk dSZECrctg0l3L9B9UuBDO+BSOmbDhHna8/aLmt/MppYzmwoYdxr/6jbJKkrGthjUw8g3 /yq1KmAm8eAkpkcjBS3/ZBfJ+TKv/LVVDsiKpgfJPPEDKpcp5cUAbEjhfUcZx1uN4oEh hRj2LVw+dYyCK/97BjVH8OZIXBGyRhRVMvlR4+vGbWuH/kIZMMoU3O3Gw/ofuBlPcHD+ 0/5drBPOIy3xcMd32kOaJwWYWJ387YrGqiYjrX/GhJ8HpXRImCD62z9ieVqi42UEch80 XSMA== X-Forwarded-Encrypted: i=1; AJvYcCUqH30wU2t3Dg/3QfNIFjl4ok8q/IPcLFnw9CZ+sNt0lRxRI+p68+s5THM+PfgvtwcrJnoyYNlyCG/wpziHBkref19p@freebsd.org, AJvYcCWPhleAoEmQG7qRkQA7RHkVTrNvZPFmL/JP9A+9MZGf2P5dl9HSMg+agA9GgFVBZO5JntE4dWvFiWeQicY4FTUiIC5XoX4=@freebsd.org X-Gm-Message-State: AOJu0YyA+JqVjMqL88020mlASe+2Ly8k2SiNqDiknpHHCy8Xw1t70Tsn zrUr3k2zQmpKNeg8MYFEF5kSr1XbbKPNCBv94QowiorY8Ht+J/lwpZaTsw== X-Gm-Gg: ASbGncsluiHjqnN5MXZICBw2bXRB1Dw1lKezIrGeoWG762FE4vgkPa2cZGJRKB+mGY8 E6+89qgoNmDQdkFlkWqzte9ktYK6IX3NoxnEmWPz4XFbgKPL4tWY9wt3MF+mH0Lgdq2ncEwrINd TZaDxwTfhNq0inQgdcQNrd8vEqg+lTanNsRQ+SohdUaPiK80dhQFPgPYlndj3ilgYFXHSmN7fXt zM2F8JSRcfBc6PLiG+1iuDmvrh25FzzgdaneNZpMd9EfEXpoSmeTQBdDOusxduF1RN4Hzg= X-Google-Smtp-Source: AGHT+IEFsNrZqVYLAw8f+QblXaN2DAw006XPus19MXhAa55NjjLgsKfFDuBkX5iVnNCmqr4hQPmp0A== X-Received: by 2002:a05:620a:3913:b0:7b6:7ac5:5def with SMTP id af79cd13be357-7bcd973dc2cmr2380743785a.20.1736634092597; Sat, 11 Jan 2025 14:21:32 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce3238003sm325827885a.2.2025.01.11.14.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 14:21:31 -0800 (PST) Date: Sat, 11 Jan 2025 17:21:28 -0500 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 926d2eadcb67 - main - netlink: some refactoring of NETLINK_GENERIC layer Message-ID: References: <202501110500.50B50TR3022609@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501110500.50B50TR3022609@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4YVtKV5nN7z4RBp X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat, Jan 11, 2025 at 05:00:29AM +0000, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: https://cgit.FreeBSD.org/src/commit/?id=926d2eadcb671dd26431a1082d4c49c3d5ad7f22 > > commit 926d2eadcb671dd26431a1082d4c49c3d5ad7f22 > Author: Gleb Smirnoff > AuthorDate: 2025-01-11 04:59:29 +0000 > Commit: Gleb Smirnoff > CommitDate: 2025-01-11 04:59:29 +0000 > > netlink: some refactoring of NETLINK_GENERIC layer > > - Statically initialize control family/group. This removes extra startup > code and provides a strong guarantee that they reside at the 0 index of > the respective arrays. Before a genl_register_family() with a higher > SYSINIT order could try to hijack index 0. This use of index zero breaks nl_isset_group_locked() and related functions, which subtract one from the index before looking it up in a bitset. The subtraction becomes an underflow, so the bitset operation triggers an OOB memory access. This can be reproduced by running the sys/netlink tests with a KASAN kernel. > - Remove the family_id field completely. Now the family ID as well as > group ID are array indices and there is basically no place for a mistake. > Previous code had a bug where a KPI user could induce an ID mismatch. > > - Merge netlink_generic_kpi.c to netlink_generic.c. Both files are small > and now there is more dependency between the control family and the family > allocator. Ok'ed by melifaro@. > > Reviewed by: melifaro > Differential Revision: https://reviews.freebsd.org/D48316