From: David Miller <davem@davemloft.net>
To: tariqt@mellanox.com
Cc: netdev@vger.kernel.org, eranbe@mellanox.com, xiyou.wangcong@gmail.com
Subject: Re: [PATCH net-next v2] net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc
Date: Tue, 24 Jul 2018 11:36:50 -0700 (PDT) [thread overview]
Message-ID: <20180724.113650.740665928630154623.davem@davemloft.net> (raw)
In-Reply-To: <1532429580-9710-1-git-send-email-tariqt@mellanox.com>
From: Tariq Toukan <tariqt@mellanox.com>
Date: Tue, 24 Jul 2018 13:53:00 +0300
> The cited patch added a call to dev_change_tx_queue_len in
> SIOCSIFTXQLEN case.
> This obsoletes the new len comparison check done before the function call.
> Remove it here.
>
> For the desicion of keep/remove the negative value check, we examine the
> range check in dev_change_tx_queue_len.
> On 64-bit we will fail with -ERANGE. The 32-bit int ifr_qlen will be sign
> extended to 64-bits when it is passed into dev_change_tx_queue_len(). And
> then for negative values this test triggers:
>
> if (new_len != (unsigned int)new_len)
> return -ERANGE;
>
> because:
> if (0xffffffffWHATEVER != 0x00000000WHATEVER)
>
> On 32-bit the signed value will be accepted, changing behavior.
>
> Therefore, the negative value check is kept.
>
> Fixes: 3f76df198288 ("net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN")
> Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
> Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Applied, thank you.
prev parent reply other threads:[~2018-07-24 19:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 10:53 [PATCH net-next v2] net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc Tariq Toukan
2018-07-24 18:36 ` David Miller [this message]
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=20180724.113650.740665928630154623.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eranbe@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=tariqt@mellanox.com \
--cc=xiyou.wangcong@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