From: Andrew Lunn <andrew@lunn.ch>
To: Yeounsu Moon <yyyynoom@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: dlink: mask rx_coalesce/rx_timeout before writing RxDMAIntCtrl
Date: Tue, 23 Dec 2025 10:43:27 +0100 [thread overview]
Message-ID: <ca3335ea-b9cd-4158-91a3-758cba9df804@lunn.ch> (raw)
In-Reply-To: <20251223001006.17285-1-yyyynoom@gmail.com>
On Tue, Dec 23, 2025 at 09:10:06AM +0900, Yeounsu Moon wrote:
> RxDMAIntCtrl encodes rx_coalesce in the low 16 bits
> and rx_timeout in the high 16 bits. If either value exceeds
> the field width, the current code may truncate the value and/or
> corrupt adjacent bits when programming the register.
>
> Mask both values to 16 bits and cast to u32 before shifting
> so only the intended fields are written.
It would be better to do range checks in rio_probe1() and call
netdev_err() and return -EINVAL?
Anybody trying to use very large values then gets an error message
rather than it working, but not as expected.
Andrew
next prev parent reply other threads:[~2025-12-23 9:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 0:10 Yeounsu Moon
2025-12-23 9:43 ` Andrew Lunn [this message]
2025-12-27 8:55 ` Yeounsu Moon
2025-12-30 10:57 ` Paolo Abeni
2026-01-03 9:26 ` Yeounsu Moon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca3335ea-b9cd-4158-91a3-758cba9df804@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yyyynoom@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®