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]
Message-ID: <78C9135A3D2ECE4B8162EBDCE82CAD7702243AEB@nekter>
Date:	Fri, 31 Aug 2007 21:43:37 -0400
From:	"Ramkrishna Vepa" <Ramkrishna.Vepa@...erion.com>
To:	"Jeff Garzik" <jeff@...zik.org>
Cc:	<netdev@...r.kernel.org>, "support" <support@...erion.com>
Subject: RE: [PATCH 2.6.24 4/5]S2io: Check for CARD_DOWN before handling traffic

Jeff,
> > - Added check to return from the traffic handling function, if the
card
> status
> >   is DOWN.
> >
> > Signed-off-by: Sivakumar Subramani
<sivakumar.subramani@...erion.com>
> > Signed-off-by: Santosh Rastapur <santosh.rastapur@...erion.com>
> > Signed-off-by: Ramkrishna Vepa <ram.vepa@...erion.com>
> > ---
> > diff -Nurp patch3/drivers/net/s2io.c patch4/drivers/net/s2io.c
> > --- patch3/drivers/net/s2io.c	2007-08-15 08:57:32.000000000
-0700
> > +++ patch4/drivers/net/s2io.c	2007-08-15 08:42:14.000000000
-0700
> > @@ -2927,6 +2927,11 @@ static int s2io_poll(struct net_device *
> >  	int i;
> >
> >  	atomic_inc(&nic->isr_cnt);
> > +	if (unlikely(atomic_read(&nic->card_state) == CARD_DOWN)) {
> > +		atomic_dec(&nic->isr_cnt);
> > +		return IRQ_NONE;
> > +	}
> > +
> >  	mac_control = &nic->mac_control;
> >  	config = &nic->config;
> >
> 
> invalid return value, for this function
> 
> Overall, this looks quite racy -- why does the card state differ from
> net_device state in the first place?
[Ram] Agreed, it is racy. Will use test_and_set_bit(), set_bit() and
clear_bit().
The card reset could be initiated due to an internal error detected in
one of the blocks in the chip, while interrupts are still occurring.
There is a  net_device state (LINK_STATE_START) set at open and reset at
close but none for temporary disabled/enabled states. Did you want us to
use this enum along with the CARRIER states?

Ram

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ