linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Jes Sorensen <jes@trained-monkey.org>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	"open list:HIPPI" <linux-hippi@sunsite.dk>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: hippi: incorrect address masking and compare operation
Date: Fri, 2 Jul 2021 11:42:17 +0100	[thread overview]
Message-ID: <8931251f-b24a-5043-3bdd-f6ea810759f3@canonical.com> (raw)

Hi,

Static analysis with Coverity has detected an issue in
drivers/net/hippi/rrunner.c where a masking operation and a comparison
is always false.

The analysis is as follows:

656                /*
657                 * Sanity test to see if we conflict with the DMA
658                 * limitations of the Roadrunner.
659                 */

Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
dead_error_condition: The condition ((unsigned long)skb->data & 0xfffUL)
> 18446744073709486295UL cannot be true.

660                if ((((unsigned long)skb->data) & 0xfff) > ~65320)

Logically dead code (DEADCODE)dead_error_line: Execution cannot reach
this statement: printk("skb alloc error\n");.

661                        printk("skb alloc error\n");
662

I suspect the masking 0xfff is incorrect here, I think it be ~0xfff but
I'm not 100% sure.

Colin

                 reply	other threads:[~2021-07-02 10:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=8931251f-b24a-5043-3bdd-f6ea810759f3@canonical.com \
    --to=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jes@trained-monkey.org \
    --cc=kuba@kernel.org \
    --cc=linux-hippi@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).