Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7341606rdb; Wed, 3 Jan 2024 12:27:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXxHSr+VoM1jUzoxXGoNkRGe0vNrp6B6z4D8k3yXZ9cb7TXVEAyag21YTE0EMTEdFZ4sad X-Received: by 2002:a05:622a:1344:b0:428:3234:9a0 with SMTP id w4-20020a05622a134400b00428323409a0mr2786815qtk.62.1704313646749; Wed, 03 Jan 2024 12:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704313646; cv=none; d=google.com; s=arc-20160816; b=NI5ncKS90+DQBbUYKy0ewZWhBix3yTY/p8eS21n8K+cNy87aWrHXO9CC6heNj3juuh hGZsqZJXy3+zyO5/1C6J9Xg14fbHQOhuAaknvZZOp78nUwQbDQ7Y4LMaB8kOqNrVprJX ReFKcnRgS6sisHwsfy9SQ7Z7JFnwqo9Hhc/TxVFcUXTdM/dUKJZws7ZVr0Nhr9dvni9d lLZCQvaPeL2WMo5AHHNGsBxMa3wHbzZG9VVXdVgeaZyMigk+3BadG1rS9SjQwTokggoN 4qGvY6e69MM5BLU2BtIOrOk+tGsK9xkhWQqAbq04aTJuganV+J+fKbrM4lYEFEHYvhFW szrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xcsOQ9nD5GPnMMvdZNgPzZalWOKW9Ch4bNlsftdutyM=; fh=5BXPZK1748bQSU/1KUky8kQhKMc4K8EWxa7ssteKdXg=; b=PKImKB4Y6T9Ph0nPJ4U0vAu5NOXcR23BO4LcmeYa1xDAiFAWxIKqs1SOROuxxkWa6z zH9gtuFe94kYL/LZxfaz8KqvE8crbEnVZnednQFg5UbzfA3PoX1fNp0mOrDmlPwGQRJb r4M7H6uryF8GbHIxzO8MCCJgsUNRKjK6d3mr2o/xnDp7dU6NvXsUFh+Pka1Q6bbk4xOp zTz+wW97XEuKf+iCrFcBbdcbEjYWFieFfT/c+qUogzC2kYsukdDgmTP0lO61tCMmEbqQ ek/MEHGNhPq86DJ6O5CgoSPAZwGDpm1fNcyxZGtVYKDypx7RsVCi56di9e/HEmxsPoh2 4/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=YVpFbnd6; spf=pass (google.com: domain of linux-kernel+bounces-15984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15984-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c11-20020ac87dcb000000b004280a43e06fsi11625960qte.179.2024.01.03.12.27.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 12:27:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15984-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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=YVpFbnd6; spf=pass (google.com: domain of linux-kernel+bounces-15984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15984-linux.lists.archive=gmail.com@vger.kernel.org" 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 816971C24497 for ; Wed, 3 Jan 2024 20:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BEA11D54A; Wed, 3 Jan 2024 20:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="YVpFbnd6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 3B82B1D52F for ; Wed, 3 Jan 2024 20:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6d9bc8939d0so2945603b3a.0 for ; Wed, 03 Jan 2024 12:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1704313638; x=1704918438; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xcsOQ9nD5GPnMMvdZNgPzZalWOKW9Ch4bNlsftdutyM=; b=YVpFbnd61kSxJs8pNoR9WNm0ig9qBgLqqwQ6bHkBVroBOsf8s41xdjjAh4ZxmfVrQZ AONmXMOd2WkX2mU/WfkEDkvqS9zPIKm6LVM8q05FrNfqxIWSMxgwZj/LuqD/5yLSz04s wkykAVRS/sI+EvER9WlsohNwCOj2n5RwvWwg9FRmBrc0QhqLr/TXiXJho89S1xixq8ES H/sRWcu2Z1qvTfkPUQB8RDcDZisnB5BS1LIEG13Q5rO/ZCOjnoa1VtEEJWnbwg+uvWsb Tp+ZZw9g/CLcvcx/c2uqa+Pghl1HgmqMX6LfNxj3W790rbjWwIKos73M3f1p5uWh1yEV iiJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704313638; x=1704918438; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xcsOQ9nD5GPnMMvdZNgPzZalWOKW9Ch4bNlsftdutyM=; b=TXqDYW1W4bvTwqUrRJsKcFreIGRaQcSPQ3JsbHiNZmkoCVgCTUKmyhrZPYXwI6eVNi Pn2d+DEpgTonPRTkydqy+XCgrzyxSEUapJGoOfCQX8oV2pvgB1g6rdI/Uy6Cjesyu4F4 o+Eg1Zayz/WLcCfNO/s/cYPE/TJxKk6EWhL6rLzllOJ3nGGvjxRbhdSLR2OZ+FQHZeST 3qyGqCZfCY766gNIZmMyoCKIw7oX77207Wlb6yFwICJSrXUQekFrtwkmnoWnreCmXid3 dSCQzW26lmAe40QsCXk1ULIhWOZYTcEDoEA3nGSLeP4zIpesc1OPPbC1Qdg1EKq9Mx+V ZvXg== X-Gm-Message-State: AOJu0YzyGk4HtEIKWkY4wZXwDnzSyqOwHbQCnM2+qigxtfATn60uzI43 YaafRcoKFGg9THSuvn1Rz8yayvgbEVjtuKg2xKXMuMVm/lo= X-Received: by 2002:a05:6a20:938b:b0:197:58b5:3251 with SMTP id x11-20020a056a20938b00b0019758b53251mr2377252pzh.113.1704313638634; Wed, 03 Jan 2024 12:27:18 -0800 (PST) Received: from ghost (070-095-050-247.res.spectrum.com. [70.95.50.247]) by smtp.gmail.com with ESMTPSA id u16-20020a056a00099000b006d9c7f2840bsm16045592pfg.57.2024.01.03.12.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 12:27:18 -0800 (PST) Date: Wed, 3 Jan 2024 12:27:15 -0800 From: Charlie Jenkins To: Dan Carpenter Cc: oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Palmer Dabbelt Subject: Re: arch/riscv/kernel/module.c:639 process_accumulated_relocations() error: uninitialized symbol 'curr_type'. Message-ID: References: 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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 02, 2024 at 03:37:34PM +0300, Dan Carpenter wrote: > On Wed, Dec 27, 2023 at 04:59:25PM -0800, Charlie Jenkins wrote: > > On Thu, Dec 14, 2023 at 11:00:46AM +0300, Dan Carpenter wrote: > > > On Wed, Dec 13, 2023 at 11:27:02AM -0800, Charlie Jenkins wrote: > > > > > 8fd6c5142395a1 Charlie Jenkins 2023-11-01 638 } > > > > > 8fd6c5142395a1 Charlie Jenkins 2023-11-01 @639 reloc_handlers[curr_type].accumulate_handler( > > > > > ^^^^^^^^^ > > > > > Can the list be empty? Uninitialized in that case. > > > > > > > > That's a tricky one, the list cannot be empty. Each bucket in the > > > > bucket_iter is guarunteed to have at least one rel_entry. I can probably > > > > resolve this by extracting this for loop into a do-while loop. > > > > > > You can just ignore false positives. It's not really a fix to change it > > > to a do-while loop. I reviewed the do while code before reading this > > > email and I still wondered about empty lists, but just to hear that it's > > > not going to be empty is enough. Just the email was sufficient. > > > > > > regards, > > > dan carpenter > > > > > > > The fix isn't the do-while loop but rather the use after free, the > > incorrect sizeof, and incorrect error handling when > > initialize_relocation_hashtable fails. I decided to include the do-while > > code because I was already touching the surrounding code. Can you review > > [1]? If you would prefer that the do-while is reverted, I can do that, > > but it is important that the rest of the fixes are merged before 6.7 is > > released. > > > > [1] https://lore.kernel.org/all/20231213-module_loading_fix-v1-1-da9b7c92ade5@rivosinc.com/ > > > Most subsystems wouldn't merge a patch like this which does so many > things at the same time... That is a good point, I split it across 4 different patches. https://lore.kernel.org/linux-riscv/20240103-module_loading_fix-v2-0-292b160552c9@rivosinc.com/ > > regards, > dan carpenter >