From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.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 3781B38F925 for ; Sun, 26 Apr 2026 19:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777233456; cv=none; b=R+MvvGwwLhEk6HN8Qte1h47hwxcS9zwNahTFVUppI3nG8En2G711Bc2S0TO/vcoWht0H3XvZxyJS+xGbep981TrWlUThNh4PYhIA2KlQvBdHOaIDevPFGSVXTfbquHKqhchWUKQqaLq66QlrhfeJJuVRTmooHfRT4QIkhoIpqSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777233456; c=relaxed/simple; bh=j+sf1c1fROzf0gnuoplaarm1uc6+4qSB5pi/L+eIL8w=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=eP+P+nRv67GwNvCaXeVFsT3McwlJh3F8W0NDP1kk3/Uic7pRJY9DomCUQJ9VXEyE83o1wRM4EeBGvYYSBgpsESpeuRiMFNj3SBai63ZmaIkzTMOP2fA8eX1NKXAGD8wMAhkaRtASvipH6/j+wIHNfeSO5CpmkJD/MvL9ISXXqlE= 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=AwYLNPVW; arc=none smtp.client-ip=209.85.167.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AwYLNPVW" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5a41a9a97d3so1355792e87.1 for ; Sun, 26 Apr 2026 12:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777233453; x=1777838253; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding :disposition-notification-to:references:in-reply-to:date:cc:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=j+sf1c1fROzf0gnuoplaarm1uc6+4qSB5pi/L+eIL8w=; b=AwYLNPVW98a1T8lPAObCPfneeqxig6Q1KmYLTKOiCcpAzswtzVzs2zuBtnI8oHcBun iiB90tO+FhmyJt/HAgqHIAtLsUc2ysktrg+yG0IEba8mjyEzK71Z6d619xo9d/JqCHB+ SnlVkH1ipDQvZSDBfJ6DAi9qT2Q2vVtQXmQK0mS4V5TkZ1p2CDirg6wHd6gwWFL/CKKk wQZWBHf1C/CTcj5RxiGWtKkrBuqlN0uW8Iw3iq4cQQZOBdqU7fxTG80COseYKjKySW48 fV4a4BPCbXIEHTSz5NOhPSwOkLsxCpD2XyJnelmE2M3ZV7lZeucVmSgQlVfk8xUNytvL RGzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777233453; x=1777838253; h=mime-version:user-agent:content-transfer-encoding :disposition-notification-to:references:in-reply-to:date:cc:to:from :subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=j+sf1c1fROzf0gnuoplaarm1uc6+4qSB5pi/L+eIL8w=; b=RYmmXHlX1U/ElujiAuA56BFfNzBb1eGLlLQseJABw+IUbREiH2FJwfL6wFmjysJ+yB iELQTbc5PmwR0scVhlXB6Ucm2hvBpt4oq44bZ7dzRg1ROTGJMCiD6uaUfkMTPCsy2ycp G5Co+fX47QSZk1f7/NyXQrwOrSzLXI0WVKcQKo70I69xQc8Ztk+hQEb3ZSrORw75Rei3 oDwKgUtA7fdJUa8Mw0UvqMe5C39o0O7AR0haYW6/ZTbAxgXE7vdfkb3VbxXWyYP9U/51 0CrwNoUYDdhcTeHuAY2Vl5cHp+gnrjPuRJB3yINlgWooQ1qNggFP5ANFgkzkyXl6JSne lXdw== X-Gm-Message-State: AOJu0Yzek0Ptj2uuZy2ssfpwVBisQ9FW8P3NWHI2zxJ+AYVy34d+iGD6 p1ADD9rTrZveVm6SMFG8M+KsMbJIsxo6D4wqwTu4ZSgQiftZPLDIa8b1 X-Gm-Gg: AeBDievJyRtbP5nDAmGhiSJ5RJ+eTfThKYaxv3qZvhwMU/m2qsxnobypaEJYcd2xt1z 0KlBuO9ANVEsvGvv3+aKIBTtLcSRZra8R/HaRybzh4xi1Ly1jIUbC9rQ/s09wGoK+RdZY/RlGYE /iXrSrIDQXB3wgePVSSCn2zS+1uNHk4g4ozCjNGwo2m6cuiFHu8Je71h5B6Sg8P7gEEj244tx70 mnqHFetfu3uf1Li2BNvVuJUM5xHPrMLhAiCYhI1/466mPuJ/hbHijeNaxq4gPF3Akfedr2pLkGu KmAiVz+okoNZPq67PUK79fU5CTFTk6VK0eIwaUXMDeh512GjI9lFoNRbP7jIw1jqooUJboqd4ya n59IouMIL9CGuP9R5/maza2MJ25nomTAFQ4eWFbVSuv2izB2gW0K+w14wKIVxlBRJYlg8AwOFNz oZCEUAR7WhV6OpHVjJQwWw0znsHOZ6tXcbC/GoRFmJwQTk3e2kjx990fs0+2H8XiYBLhbgW3/SG 7xfUy8BE7ljfQnBcec4F9qSbrsOTrN8 X-Received: by 2002:a05:6512:1590:b0:5a1:38c4:424e with SMTP id 2adb3069b0e04-5a4172fccc6mr5122413e87.7.1777233452916; Sun, 26 Apr 2026 12:57:32 -0700 (PDT) Received: from [192.168.1.239] (87-205-5-123.static.ip.netia.com.pl. [87.205.5.123]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4187e7a3fsm7630070e87.59.2026.04.26.12.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 12:57:32 -0700 (PDT) Message-ID: <25715cc23884f74a7417ba53ba144cbb7f675293.camel@gmail.com> Subject: Re: [PATCH] HID: pidff: Fix integer overflow in pidff_rescale From: Tomasz =?UTF-8?Q?Paku=C5=82a?= To: Markus Elfring , linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , Oleg Makarenko Date: Sun, 26 Apr 2026 21:57:31 +0200 In-Reply-To: References: <20260421194941.1422722-1-tomasz.pakula.oficjalny@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sun, 2026-04-26 at 12:48 +0200, Markus Elfring wrote: > > Rescaling values close to the max (U16_MAX) temporairly creates values > =E2=80=A6 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0temporarily? >=20 >=20 > See also: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/D= ocumentation/process/submitting-patches.rst?h=3Dv7.0#n145 >=20 > Regards, > Markus I don't quite understand the point. I'm aware of the error but didn't have time to look onto it yet. I probably just need to switch to the division functions exposed by the kernel. As far as the other stuff you mentioned, I don't get it. I don't think it would make sense to mention the 20 yo commit that added this driver. As far as the temporary status of the value. It only exceeds the s32 range after the multiplication, and is reduced right after, during division. I think "temporarily" applies here perfectly? Maybe I'm not seeing something here, please elaborate so I can fix it :D Tomasz