Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp577976rdb; Wed, 17 Jan 2024 10:32:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd+rINDXV5hrrYZD3l9Nfi9Y20+3Ha+ih+qZ5XllyANv08S7OCc3rzk9/+tTyV9dQUcErb X-Received: by 2002:a05:620a:8223:b0:781:bdec:420d with SMTP id ow35-20020a05620a822300b00781bdec420dmr9449898qkn.114.1705516348987; Wed, 17 Jan 2024 10:32:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705516348; cv=pass; d=google.com; s=arc-20160816; b=y9Szjn5xpUedOz0gbjlay8bBxSih+Eu3rS4Xz/j8YWAMZoJ3NWa4ahVVpHnbVfclNf tU2CQHCffXf2zDsEZ/ffz/FMCgl8hqsupOltj18FKwWZVFd5SLRbTANDDctPf6dpZlNX L9wshk8jnRLr9jj4DJSJ+E7/cr7VZ4J/Qj1LGttVI5pfh9kJPlfvJ9vwNaM13yvF+X73 9zdV+fy/T1u9nUNejwUDVvl6L5pemw7G/39XSYY1wQ4y76+TPDKUCrQquCo/MjRe/h1J PMLIvhyMXINs9MZEEK+0629xVn4ZqrBeiu/aj6oqSKlV1WO+KK5NE45ekulZOvt4YXZ1 OuLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=dowglsIPVbYVAFa4rVjn+rlDsEzlw1XXMllVZiyv4c4=; fh=AMP6jLY/YgAkWlcuKAii2N0FHrlJK6sTn/slWMNRfkk=; b=jxhMMetNsi+MQO2zFywxEusvbThFlBY1JOJxzswjdId/t8eyPEewYgdXvF4yBDvqXh FfiUzx8pVpwJXv4hgmlSkmFPKaz3zI8Bb4Nm8iuGn6rR0JlvlES5jRyKG2EBIb0K++Yn WmRtMYhgpnxk/eh6BejSVeOtV0hYTvbuYk5TQlKbHgllRLqHMy+3xAIx2ALdSnCyCSJu Jbhw1NynjFetIYKspTWz/y5OWyYJodAY53rXlh0fIoRCqhJsMnmfjJL+WWpe9iaLelXP LnHXYZsZkf/Rk1Xh9w57qhkKW8kRBADpuvpkgZm9Xt1p+TSCVo7mJiuLP/ihDthN9Wip ohNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TwTr7tL+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-29319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 j15-20020a05620a0a4f00b0078132aff7d3si12271070qka.536.2024.01.17.10.32.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 10:32:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29319-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=@linaro.org header.s=google header.b=TwTr7tL+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-29319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 B96F11C21959 for ; Wed, 17 Jan 2024 18:32:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FC5423753; Wed, 17 Jan 2024 18:32:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TwTr7tL+" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 AB57F22F0D for ; Wed, 17 Jan 2024 18:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705516335; cv=none; b=CEWLmvsOcU9nACQUEcX8zbo4e88gMFMZ1G1HMtuIr5C+Tm3GxxsapS1dDe6AwEKVN3l41MmkA0qnjJj2iCOUY+hEtQ++U1aFWfepbeJ6zAntXbJF4+3f9UZHatSgvdz3UTlbLxsJPPcMhufVRiCNqSacv+UlGyg2hFOSyzi+oeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705516335; c=relaxed/simple; bh=GJoKVb2+DXUwHo6EryFUbR0bKGFrwQdlvWC+jGiPY6k=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:Date: From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:X-Mailer; b=ikATTLcBp3AOA9Bq2sdBnowqktNlw9oT2h3NG+g9l8mXsZ9SC9ShKgwZmuDsdx6xbiYrOICAtPiiaZKxjaijFMJzS/9SeDNqrj2RZ0lTa1ohCJcXXd33VHJtZwS/jS1K82rkxyvGsU5QC3a6XL0P4KE0Z2LRlHSWqHvFjEpLxEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TwTr7tL+; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so126812315e9.0 for ; Wed, 17 Jan 2024 10:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705516332; x=1706121132; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=dowglsIPVbYVAFa4rVjn+rlDsEzlw1XXMllVZiyv4c4=; b=TwTr7tL+WDZwmHbKemDUyUDIWb4rMpnc4+pKMYXD0kBmNUhOxA2BQCrDumLI49gUkE SItrJ7H+S6tadYJjJB0HhN6c7BO4OguGscHfxRnOnavEK6nTgFWY20WxemizPHzBDsI2 1yCI9pmUvXn41H5HhNmLIDYwGWm9MTTMOmle8NHNJPE4m8M5FVeh+h6wy63h82g4pFTk hE3JYSyUOy9LMoGkudQ1dytir8o/fvxTRHzJiNkUB/ooMJ++fajbjI9Dr+fmwzwgGA5S wGwcFo0FefarJ73kGoG9DNY1hiOjL/AOcI4Uq85wiJdwSXfWF6UnNs/dw8tust6D57Iy ml8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705516332; x=1706121132; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dowglsIPVbYVAFa4rVjn+rlDsEzlw1XXMllVZiyv4c4=; b=HZRwYQeOzQsWQdNtWIRjGE8hF5l0fVQG/aUt+jxr0HZdQswvQ73u/TLk/8ir9mWUlF 29iICT6dkHpXwPllIZTZ/07xclkuEabYFLs+mKVadoKU9f6HU7K8QpnCevWj+Z9zoJ+r FXN59xYbhAlvYg0eReQODmcKhqxstzGigTcfuCHcSKMOB4XeRP/YrRaJs4MMbkX2/NdZ L2EeqSC8YTCRI/Ce9gtQ1Fgm5lxmfD9TblFYqzr67a8UEsbuSpo0LqRMJ5j22HCzUrkP brxZw30jMpHRdCuarmrhf1v61LlKZopnKt551LU0tO2HdeuKklRhJ4XgaukS86b1xPAw 3fjQ== X-Gm-Message-State: AOJu0Ywd9FionUedehd4wKVSW6VEO5ism1+/2QT1WnDNezZnqWSySXsd YZloODTc95hq5QuQRZeHWfIax+f9qm4kYQ== X-Received: by 2002:a05:600c:45ce:b0:40e:6e84:e95f with SMTP id s14-20020a05600c45ce00b0040e6e84e95fmr2723425wmo.252.1705516331931; Wed, 17 Jan 2024 10:32:11 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id o8-20020a05600c4fc800b0040e549c77a1sm27223849wmq.32.2024.01.17.10.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 10:32:11 -0800 (PST) Date: Wed, 17 Jan 2024 21:32:08 +0300 From: Dan Carpenter To: Niklas Cassel Cc: Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() Message-ID: <3f9f779c-a32f-4925-9ff9-a706861d3357@moroto.mountain> 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 X-Mailer: git-send-email haha only kidding The "msg_addr" variable is u64. However, the "tbl_offset" is an unsigned int. This means that when the code does msg_addr &= ~aligned_offset; it will unintentionally zero out the high 32 bits. Declare "tbl_offset" as a u64 to address this bug. Fixes: 2217fffcd63f ("PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support") Signed-off-by: Dan Carpenter --- From static analysis (not tested). drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 5befed2dc02b..2b6607c23541 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -525,7 +525,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no, struct dw_pcie_ep_func *ep_func; struct pci_epc *epc = ep->epc; u32 reg, msg_data, vec_ctrl; - unsigned int aligned_offset; + u64 aligned_offset; u32 tbl_offset; u64 msg_addr; int ret; -- 2.43.0