Re: [PATCH 3/4] netfilter: print the list of register loggers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Engelhardt wrote:
The seqprinting (knowingly that I suggested it) has a bit of a drawback
the way you use it -- if userspace passes a buffer of, say, size 11,
then the first seq_printf will succeed in stuffing " 1 NONE (" into
the buffer; it then has 2 left. Because t->name is probably more descriptive
than that, the second seq_printf will fail, breaking out of the loop,
calling seq_stop, etc. and userspace gets 9 as the return value for
the read() it attempted. However, when userspace now tries to read()
again, as it is absolutely entitled to, the " 1 NONE (" will be printed
again into the buffer -- which is rather undesirable.
...
Maybe the authors of seq_file can offer some better function that
takes care of this?

seqfile operates on records not characters and always provides
one page of memory.

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

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux