Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp328868lqp; Wed, 12 Jun 2024 02:51:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdm15TXDJi+MGKtWMD7bN01gaRm67mSVHw22O2QD62Lc9qp2KKNQ0z4BJDpsWWCLv5WdJBM7cubmiz942ZvZ2sPJd2PR0eygAYMDWbcg== X-Google-Smtp-Source: AGHT+IHeOTw1ISv8oWh8FjDVKLXWMAi+cS1LDHaYSdnM0IMXzxSaacoP/OBnKNuM/O/WBPAHDscR X-Received: by 2002:a05:6214:488d:b0:6b0:7b86:7c4d with SMTP id 6a1803df08f44-6b1a79dc1d3mr14664926d6.50.1718185909112; Wed, 12 Jun 2024 02:51:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718185909; cv=pass; d=google.com; s=arc-20160816; b=MAgGugA5ZKRNjh8hQfdbSsGFNdZfJBVuneJr8pEGzXg7gBJS46twvjFT/fqjqGptyS ynE9vFGdw3cyY7EgTZdoH9EfiMnw6YoYLc++sgTQKRhbg1Rkj0u1MfYHCaZeWjMKQewT /LBDFg3q25IU17plonei/xas/RkuJkplwjqQK+yiLXHmOOTDFgCU67PzGWJoyum5qjpO o+Jj5XZ8v0LLWszz1oc9pNBjnBSq6gQ9aZtJGgFzKzK3TueLDHN+eMjZS6ATwBT1CcdZ VW9z3rrrIxJoL0hDbBHBdgyNr+NAlmuRI8k9tvSCXe98X/t50aJB/7kY5jq0i4DuYOnm Pf8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=0gzrM6EvAqCUYyubpdKPvo+y6fnT5QsRDHvsxqtQtqU=; fh=L5HUDKAzOFnl7vlOIlA2Bqo0aqM63kqMzL4WmeXVQjs=; b=LMo0iNP7kJMyk2c9smHHjeAaqEoGxSi0smo9+v6LoXAcECTHC2J6pCtgu6BS2dBPgi 6zFnMH+z6mHPvMUhIRLh/wSq5K3gBaAtgPV+5CDJTVU7oHXAvdfd1S3H7Bj2QfDxviro rr7x09BPiWoKVT4Kmzhxpl185d/zsUvhXxC9gGI5nNjWxXXnJ/E/0y+SJTrwmqPj98c8 DCz4YJbArEY4qQA3+xgJp0Vx5OBbnCTj+9TYDcaMGJrNXbu0+JpRR0V2kK9XXsum5/aO P08TY0eBSXLFnTd1wG1C95B4EXKUe0cFU3gcxDFkEKUYXI54CJC9DSteBn44yMZJxICR 2qig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NDyft+Uk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211297-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211297-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 6a1803df08f44-6b07366fc76si90514126d6.368.2024.06.12.02.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211297-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=@gmail.com header.s=20230601 header.b=NDyft+Uk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211297-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211297-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 C2E8B1C23238 for ; Wed, 12 Jun 2024 09:51:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4F9F16DED1; Wed, 12 Jun 2024 09:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NDyft+Uk" Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 8C861A34; Wed, 12 Jun 2024 09:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185900; cv=none; b=o4FJAMh0/5ZfF9N4yQQSPJI4eqpCZHt6+wl0CPGH0W0wZ0OvjCiP+NoCQSLBEJfBZCKEH+yMpWvOlCHcWCdF3qKgHSJFlamdcOcRpCC5U2RLagpNZ1qHRt2uP3+49LEDhsOPjUoFMTuQCXvbc9fBZKwTfckR2pYG6VocPqLK8Mo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718185900; c=relaxed/simple; bh=8dFZrXMQrpSMEZnw2V6V7d9rPJd3f8Fhs33OTTxQ9Fc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Z8pY0Wc5bHHALmCog4/MWLxzUOlu6cC4hKKJBC9cPjAucMoKMm1kwYiG87kZJI5qjDmM6kTraxk6KqAECtcQv4+dvAxZNZTIiD+xKx4yMAnLyaUtYxsJ8fn2/E5yHSCWINkKHUTiCxWVls4PymSxjHrPOspJF2sdWQsAhPEYdc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NDyft+Uk; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-6ce533b6409so1601079a12.1; Wed, 12 Jun 2024 02:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718185899; x=1718790699; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=0gzrM6EvAqCUYyubpdKPvo+y6fnT5QsRDHvsxqtQtqU=; b=NDyft+UkATa2UFldp+y4RdEVUCDXHkQnmjFPVY/a4y4kXD4nJGtpkXFINy70XzajOW jGjAiTkEenKzh4A5ScHq7pLs+ty1vWIpK9ROAqY8vS7CVM0HuUOXby37MI8O0o8w7Lo5 8nXtPPdfOLeLnJ4NtdJpHk00b3IHIiyIOU9HRU9Lc5gzTrKBVjc75KtvSWEsyHaKLAxo 8rogKJDZW9ryn10JRVsxCjw3QokRHj6VKWu/BmWzrSADBCVICWPK/JfQOy4E7ll4PdIF 7UjYH6fyBgvS3ab6awSk13Dq3WD8I8YAp+zBk6s+Sh3s2aw+Yp9hNCb0lNN40j6yWtKC TuCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718185899; x=1718790699; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0gzrM6EvAqCUYyubpdKPvo+y6fnT5QsRDHvsxqtQtqU=; b=sAW67aX0+eUTyGU0lh2T5s5t9vIcHtrz+dBrjqS+hx4S99oaFPi01i3ISNfXmB3d/e x05hVG/zY6tfqiyYr6Qep7IRHV9bGI+JSGQvupMeMYJV9+O3IDUw+Iri4gfoVhpcKzEh d1MCA6INfLPb7wVnh3e2JVVLxaR23RrifM40g7NKNB/PQAVvqFnmJJhlyN1VgECUSzbD x46SPnWd7/j6A3ojnNethbOULm+zKhzioW8by5hO8ypnwABKn7UgSFPB0m0JXH7ALLM7 8HCcTIQRWeADnF0X5MNc7ArAtOjNikkzHhsSQA7eVy5CdqYrDKqOudMUyoOOc7Hw7hWy I/gQ== X-Forwarded-Encrypted: i=1; AJvYcCWpKBFUdYnA6z/1p+jHDlh5YTpU4jruBf92UeaWFJhNBgFX9u8pvdTFbC4ytcdXEoYIyK+eyQT9ycqLNvwE5PkvpWlh98CCQRjNcdxi X-Gm-Message-State: AOJu0YxZjo8y2kOjD3uttfzeGvXtjJ+HFv0tQkTulrrIcEs3UQVPAz+T fGuS7d/oiMCWbUOij9WySkGcnkiVs/IP/Nc25VrTtK6u55hXpgzCpfU1MvWVnAc= X-Received: by 2002:a17:90b:1d0d:b0:2c3:40b7:1f6d with SMTP id 98e67ed59e1d1-2c4a7530740mr1817234a91.0.1718185898396; Wed, 12 Jun 2024 02:51:38 -0700 (PDT) Received: from localhost ([2405:201:a42a:e05e:b15d:9596:9397:9fee]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c4a9c2fa34sm1161774a91.38.2024.06.12.02.51.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jun 2024 02:51:38 -0700 (PDT) From: Mohammad Shehar Yaar Tausif Date: Wed, 12 Jun 2024 15:21:25 +0530 Subject: [PATCH RESEND] bpf: fix order of args in call to bpf_map_kvcalloc 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240612-master-v1-1-a95f24339dab@gmail.com> X-B4-Tracking: v=1; b=H4sIAJxvaWYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDM0Mj3dzE4pLUIt20VMtUM+PEJNNkS1MloOKCotS0zAqwQdFKQa7Brn4 uSrG1tQD2m2AGYAAAAA== To: Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , Mohammad Shehar Yaar Tausif X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1428; i=sheharyaar48@gmail.com; h=from:subject:message-id; bh=8dFZrXMQrpSMEZnw2V6V7d9rPJd3f8Fhs33OTTxQ9Fc=; b=owEBbQKS/ZANAwAIAVeh+rkVtmsSAcsmYgBmaW+j/5SiyBV1U+kYa1ezq8Z+KA1egtQ3xxPiO TjQprR/7qWJAjMEAAEIAB0WIQSJaujhf+zhb4nUAadXofq5FbZrEgUCZmlvowAKCRBXofq5FbZr Er8pD/488YlR0TVjaPLg3f8HjCYciHzDhSZtlc+mgsxn6oHHV5fwRfchyp82ZzPLyLaucoC0xec 8buWJEjWFJ+IoHURJ0uLl1lts58UyHHLOdu3CvQsoHzZBqpU75zDaZVDckeco2LvfuJ6Y5tZM9x VzmAkEYoYKNMWg4rMaMZ7fgaUHfKwUlLRlcuhZ2dYsqXT93ZkytWTAc5MCbryuh2y1XpUm98nwx n1pi8LzdZwKdF1QfpAKflwH7pwLi7zVLJceWZUg5FpoygGtnw4dQIwP8FtnUSpVv0f/AaJBYwou AeJIDCAJ6llJ97a+Afpdfj4zJB6Ji6K0wihM3TxA1McSqNdERYWB5Eg2Ny/K3cstxcI2bp83xMm q2WlZBydVdxQaFvxLrXGUujwENW6CoqbHYr4af5w++Otb0jriVdKqzU97XysGbZQg9owH4Iq3DB TWQyTF7NBhZapQgQNlk8dDgjl077bhdu7nOvEm+wQw7JsHOI5j2IS5By41XiHyi05/9UZovnQcX Xy3LpqGaWgiConcdPNRRGMIVkuh2kQd/j1eTlqObpRMcJ4AlhEr5xjyrGiIVtHk7NQxpNZcNY7p EjtgAgCslE6AMOlf8UpbG6KgXRjLM6MZtMf4SqqCRns1gJSxPKCqKKEoBfCFAMbeRXb4x2HY2C2 1ca/CydMvbPiNyg== X-Developer-Key: i=sheharyaar48@gmail.com; a=openpgp; fpr=896AE8E17FECE16F89D401A757A1FAB915B66B12 The original function call passed size of smap->bucket before the number of buckets which raises the error 'calloc-transposed-args' on compilation. Fixes: 62827d612ae5 ("bpf: Remove __bpf_local_storage_map_alloc") Reviewed-by: Andrii Nakryiko Signed-off-by: Mohammad Shehar Yaar Tausif --- - already merged in linux-next - [1] suggested sending as a fix for 6.10 cycle [1] https://lore.kernel.org/all/363ad8d1-a2d2-4fca-b66a-3d838eb5def9@intel.com/ --- kernel/bpf/bpf_local_storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c index 976cb258a0ed..c938dea5ddbf 100644 --- a/kernel/bpf/bpf_local_storage.c +++ b/kernel/bpf/bpf_local_storage.c @@ -782,8 +782,8 @@ bpf_local_storage_map_alloc(union bpf_attr *attr, nbuckets = max_t(u32, 2, nbuckets); smap->bucket_log = ilog2(nbuckets); - smap->buckets = bpf_map_kvcalloc(&smap->map, sizeof(*smap->buckets), - nbuckets, GFP_USER | __GFP_NOWARN); + smap->buckets = bpf_map_kvcalloc(&smap->map, nbuckets, + sizeof(*smap->buckets), GFP_USER | __GFP_NOWARN); if (!smap->buckets) { err = -ENOMEM; goto free_smap; --- base-commit: 2ef5971ff345d3c000873725db555085e0131961 change-id: 20240612-master-fe9e63ab5c95 Best regards, -- Mohammad Shehar Yaar Tausif