Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp3052483rdd; Sat, 13 Jan 2024 13:03:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IER2R1eXKmWENklWpxI47kPkI60y9YSFBVC5/BqHSFnpPnQTiz0wRarqWYX+FmTmgvYB6kT X-Received: by 2002:a05:6512:2036:b0:50e:6549:a980 with SMTP id s22-20020a056512203600b0050e6549a980mr1627364lfs.77.1705179815352; Sat, 13 Jan 2024 13:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705179815; cv=none; d=google.com; s=arc-20160816; b=J9PRE4w7tIlusF/bDAsTav2HAMnpZkOuzLQPvEtaEbIhJj32KVacz5sTXmQeglgAGg E8U3/p9lJQJu3nSCcXcgVGb8tQKxpAlYZj14hqwGTQnFxjBZv6t9f1ujHKYWWxcck353 DfBas4R92lfYBBQ7UKkQjjBML9LbzuRoBaYXpw4BZPoGL8VU1HGCIn4K70E2b4hHYge0 b0U0VQyaA1460TFbWBu+jGqe+R0QODzx++p1gjcf+gPmtD700dn4KU58eOjV+ot44D3W Mw1jybGBigsn0Ntg4I0asKgxOnTAHdyzut+JW8evkgXkTRBvdniWSbWZ9kLiyCJHNPCy Xazw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=lwGZt+LYnLHak1ltwS+QAks1XkzaNXbIWxpfqvUkZFA=; fh=KoO93oc+rh35Dse6E3I2zzS/l0F55BfqaB9nA0DuZv0=; b=kuARAg91+aYSPV6QsumMC4KRO5wl021uV6osa0asoU25YvrgXCgXsvatOWbgVdxUVM fj7jpY1e5QPZJxEn+WgwOGF4RuGXJVHy6Y5jm0yFigO9HpOX06pCDeatRvCdoTbunZc8 s44S7az+Z4o0tilVjgz8Q8yooZX0K05kdJCP2dXETZ9ASGuCWDwXnX70X14fbzeNbTIE AtkeWkRmBLUx/v/Brk9s+0Z7ywz+TPAv02quF9CrAvXgdILu55AmR0CizwphhcqDqdRk CIfn+Rt0vUjEwY8V/gZ3LBnBT5BPIa9RofwxakO5EI5tIHzC7218Ac1YOoKb6dYsyH7g S/HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jr8yqAgd; spf=pass (google.com: domain of linux-kernel+bounces-25369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25369-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d3-20020a1709067f0300b00a2c29dde73dsi2433993ejr.542.2024.01.13.13.03.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 13:03:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jr8yqAgd; spf=pass (google.com: domain of linux-kernel+bounces-25369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25369-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DEEFF1F22333 for ; Sat, 13 Jan 2024 21:03:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 024C416426; Sat, 13 Jan 2024 21:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jr8yqAgd" Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 CAD306AC2; Sat, 13 Jan 2024 21:03:21 +0000 (UTC) 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-qk1-f171.google.com with SMTP id af79cd13be357-78324e302d4so491384785a.1; Sat, 13 Jan 2024 13:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705179800; x=1705784600; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lwGZt+LYnLHak1ltwS+QAks1XkzaNXbIWxpfqvUkZFA=; b=jr8yqAgd6yeibVuRAJGaLfe+mL3b0d/IDzKkJH6CheaF6XxmVCl1KCX83QCY+X0h7N 1JfX179D17POrbvxnwXZW8rK1CV5PQ8SLNFzdrXCmBgPmjd3OiZW3NikH5Uau4KtslAm qwiEGRTfEhltnSBb5YRbgKEGpv3aK2XLNm3FuCQsqtUNmoA87/Dzi2JIy/5j3UZStpQt Bhn1rN2qoOcGZwNM1DLzKiu4cMo5CpGx05prFouR40REagAk2Yuv6p4/XJeP5NpcWFdE PCqr6h6H+GfegCLBjDgX00T1BClreb0/hgVx4xuDOPNM6+C4NLdihA1fsh+SJZoLs8TH JufA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705179800; x=1705784600; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lwGZt+LYnLHak1ltwS+QAks1XkzaNXbIWxpfqvUkZFA=; b=XzDe4S6gqPHHdLND6EMY+FGzbFjuZyMaTb+/h0ZQlw58RzGOcsePmANYkxgsoMhslB 46Lts0JKePQOIz4PZ8zx8xqcY9LeucnvpUN2qs51ZaAyNawICl69unb9vHkY1cf5M1Kg 4E/Te/FkXVtfqkUqIV0+SSbcunFRCuAt0ITSUJGYeXx7HutJfYCGDnysDbantrXYazFE uIpAiF6CFR8KEpWyJoteHQrZ7od8qjGjTwiu+u6TWE1YgLakBDuaHaRs1fqY8/aTOJ8A 7Eofm8LSE0I7mLOwqA2MSGVgJM4iuZjQNO8hrySE8NMJ1id37JefCVuM4IHDKW+0D1wa NPjw== X-Gm-Message-State: AOJu0Yx+XuLr8MgGRntsx4m5J8mx7DnfP74AcClTTeyP40FX5XHOLyxu sWk82pEMquHaANtz4/gq7MKD5u6odrg= X-Received: by 2002:a05:620a:4155:b0:783:3579:242e with SMTP id k21-20020a05620a415500b007833579242emr4293728qko.55.1705179800496; Sat, 13 Jan 2024 13:03:20 -0800 (PST) Received: from [192.168.1.3] (ip68-4-215-93.oc.oc.cox.net. [68.4.215.93]) by smtp.gmail.com with ESMTPSA id gf13-20020a0561224e8d00b004b77e4dfcc8sm215117vkb.19.2024.01.13.13.03.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Jan 2024 13:03:17 -0800 (PST) Message-ID: <5750a0c0-3ad6-409c-9b76-82c5c015e719@gmail.com> Date: Sat, 13 Jan 2024 13:03:14 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: ravb: Fix dma_addr_t truncation in error case Content-Language: en-US To: Nikita Yushchenko , "David S. Miller" , Jakub Kicinski , Paolo Abeni Cc: Sergey Shtylyov , Claudiu Beznea , Yoshihiro Shimoda , Wolfram Sang , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240113042221.480650-1-nikita.yoush@cogentembedded.com> From: Florian Fainelli Autocrypt: addr=f.fainelli@gmail.com; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYWluZWxsaUBnbWFpbC5jb20+wmYEExECACYCGyMGCwkIBwMCBBUCCAME FgIDAQIeAQIXgAUCVF/S8QUJHlwd3wAKCRBhV5kVtWN2DvCVAJ4u4/bPF4P3jxb4qEY8I2gS 6hG0gACffNWlqJ2T4wSSn+3o7CC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Awt97AqQZXegbfkJwX2Y53ufq8Np3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mz Joil+u3k01ofvJMK0ZdzGUZ/aPMZ16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKy kuVag+IijCIom78P9jRtB1q1Q5lwZp2TLAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9 aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTC y5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6DChDrguup2aJVU8JPBBgRAgAPAhsMBQJU X9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMeqX5aD/aq/dsbXSfyAKC45Go0YyxV HGuUuzv+GKZ6nsysJw== In-Reply-To: <20240113042221.480650-1-nikita.yoush@cogentembedded.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/12/2024 8:22 PM, Nikita Yushchenko wrote: > In ravb_start_xmit(), ravb driver uses u32 variable to store result of > dma_map_single() call. Since ravb hardware has 32-bit address fields in > descriptors, this works properly when mapping is successful - it is > platform's job to provide mapping addresses that fit into hardware > limitations. > > However, in failure case dma_map_single() returns DMA_MAPPING_ERROR > constant that is 64-bit when dma_addr_t is 64-bit. Storing this constant > in u32 leads to truncation, and further call to dma_mapping_error() > fails to notice the error. > > Fix that by storing result of dma_map_single() in a dma_addr_t > variable. > > Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") > Signed-off-by: Nikita Yushchenko Reviewed-by: Florian Fainelli Nit: since this is a bug fix you should prefix your patches with "[PATCH net]", see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/maintainer-netdev.rst#n62 -- Florian