Re: [PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-21 Thread Laurent Vivier
Le 18/10/2019 à 02:19, Shu-Chun Weng a écrit : > In any of these `*_for_each_*` functions, the last entry in the buffer (so the > "remaining length in the buffer" `len` is equal to the length of the > entry `nlmsg_len`/`nla_len`/etc) has size that is not a multiple of the > alignment, the aligned l

Re: [PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-18 Thread Laurent Vivier
Le 18/10/2019 à 20:27, Shu-Chun Weng a écrit : > (Re-sending to the list because I forgot to turn off HTML before and > it was bounced.) > > That does prevent the integer underflow, but it also changes the > behavior and I don't think the new behavior is desirable. > > If the extra payload has a

Re: [PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-18 Thread Shu-Chun Weng
(Re-sending to the list because I forgot to turn off HTML before and it was bounced.) That does prevent the integer underflow, but it also changes the behavior and I don't think the new behavior is desirable. If the extra payload has a smaller alignment than the header, it makes sense for the use

Re: [PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-18 Thread Shu-Chun Weng
That does prevent the integer underflow, but it also changes the behavior and I don't think the new behavior is desirable. If the extra payload has a smaller alignment than the header, it makes sense for the user program to generate a nlmsg_len that is not a multiple of the alignment. When it's th

Re: [PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-18 Thread Laurent Vivier
Le 18/10/2019 à 02:19, Shu-Chun Weng a écrit : > In any of these `*_for_each_*` functions, the last entry in the buffer (so the > "remaining length in the buffer" `len` is equal to the length of the > entry `nlmsg_len`/`nla_len`/etc) has size that is not a multiple of the > alignment, the aligned l

[PATCH] Fix unsigned integer underflow in fd-trans.c

2019-10-17 Thread Shu-Chun Weng
In any of these `*_for_each_*` functions, the last entry in the buffer (so the "remaining length in the buffer" `len` is equal to the length of the entry `nlmsg_len`/`nla_len`/etc) has size that is not a multiple of the alignment, the aligned lengths `*_ALIGN(*_len)` will be greater than `len`. Sin