lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 3 Apr 2012 21:23:55 +0200
From:	Torsten Kaiser <just.for.lkml@...glemail.com>
To:	David Miller <davem@...emloft.net>
Cc:	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT] Networking

On Tue, Apr 3, 2012 at 2:34 AM, David Miller <davem@...emloft.net> wrote:
> 7) virtio_net accidently uses net_ratelimit() not only on the kernel
>   warning but also the statistic bump, fix from Rick Jones.

I just saw this commit land in Linus tree and I think its got its
parentheses wrong.

Old code (minus the dev_warn()-messages):
if (net_ratelimit()) {
  if (likely(capacity == -ENOMEM)) {
    dev_warn(...);
  } else {
    dev->stats.tx_fifo_errors++;
    dev_warn(...);
  }
}

New code (minus the dev_warn()-messages):
if (likely(capacity == -ENOMEM)) {
  if (net_ratelimit()) {
    dev_warn(...);
  } else {
    dev->stats.tx_fifo_errors++;
    if (net_ratelimit())
      dev_warn(...);
  }
}

Now it will count -ENOMEM errors that were not logged..

I think, intended was:
if (likely(capacity == -ENOMEM)) {
  if (net_ratelimit()) {
    dev_warn(...);
  }
} else {
  dev->stats.tx_fifo_errors++;
  if (net_ratelimit())
    dev_warn(...);
}

HTH, Torsten
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ