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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1270534887.9013.59.camel@edumazet-laptop>
Date:	Tue, 06 Apr 2010 08:21:27 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Américo Wang <xiyou.wangcong@...il.com>
Cc:	Dave Jones <davej@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Wu Fengguang <fengguang.wu@...el.com>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] /dev/mem: Allow rewinding

Le mardi 06 avril 2010 à 13:30 +0800, Américo Wang a écrit :
> > Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
> > ---
> > diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> > index 1f3215a..3973a1d 100644
> > --- a/drivers/char/mem.c
> > +++ b/drivers/char/mem.c
> > @@ -710,11 +710,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
> >        switch (orig) {
> >        case SEEK_CUR:
> >                offset += file->f_pos;
> > -               if ((unsigned long long)offset <
> > -                   (unsigned long long)file->f_pos) {
> > -                       ret = -EOVERFLOW;
> > -                       break;
> > -               }
> 
> Why completely dropping the overflow check? What you need to do is just
> adding the 'offset < 0' case check.
> 

Because the overflow check at this point is completely redundant, it is
performed a few lines after...


--
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