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, 17 Feb 2015 16:55:10 -0800
From:	Joe Perches <joe@...ches.com>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ipc: Remove uses of return value of seq_printf/seq_puts

On Wed, 2015-02-18 at 00:27 +0000, Al Viro wrote:
> On Tue, Feb 17, 2015 at 04:09:44PM -0800, Joe Perches wrote:
> > On Tue, 2015-02-17 at 23:16 +0000, Al Viro wrote:
> > > Most of the time checking return value of seq_...() is better replaced with
> > > not doing that.  And "must check return value and Do Something(tm)" is too
> > > strong habit for enough people to cause recurring trouble.
> > 
> > Does SEQ_SKIP still have value?
> 
> Yes, it does, but it's not an error - it's an equivalent of "empty the buffer
> before returning".  Basically, it's "I've decided that this entry shouldn't
> produce anything".  Look at the caller:

Yeah.

I should have looked at the traverse function first.

>                 error = m->op->show(m, p);
>                 if (error < 0)
>                         break;
>                 if (unlikely(error)) {
>                         error = 0;
>                         m->count = 0;
>                 }

Basically all the show functions that I converted
to use seq_has_overflowed() should just return 0.

There are only 3 current uses of SEQ_SKIP

drivers/infiniband/hw/qib/qib_debugfs.c:119:            return SEQ_SKIP;
drivers/infiniband/hw/qib/qib_debugfs.c:177:            return SEQ_SKIP;
drivers/infiniband/hw/qib/qib_debugfs.c:183:            return SEQ_SKIP;

As far as I can tell, these uses would be fine
not using SEQ_SKIP and just emitting 0 instead
of nothing.


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