<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 8 May 2021 at 15:33, D. Hugh Redelmeier <<a href="mailto:hugh@mimosa.com">hugh@mimosa.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">| From: Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com" target="_blank">andrew.cagney@gmail.com</a>><br>
<br>
| The old behavior was that a NULL implied that the nested struct, if any,<br>
| could be ignored.  I'd call that obvious behaviour.<br>
| (passing a pbs when not needed was benign).<br>
<br>
That's not what the contract said.  Ever.<br></blockquote><div><br></div><div><div>So let me see</div><div>- what matters is the code, and how developers are using it in the wild</div></div><div>vs:</div><div>- what matters is the contract, no matter how much this differs from how the code is being used</div><div>Given a choice, I always assume the former is more up-to-date.</div><div>Why not just correct the description.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
| Now, if this is done wrong, and on a rarely executed code path, we've got a<br>
| ticking time bomb.<br>
<br></blockquote><div><br></div><div>The packet parser code is at the mercy of what the attacker is sending over the wire.</div><div>So we need to be defensive against that, and against our own code.</div><div><br></div><div>Minimally, this code shouldn't abort.</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
|  Would it have crashed pluto?<br>
<br>
I wish.<br>
<br>
If I remember correctly (no guarantee -- this was a transient state in<br>
development a while back), the code got further before it went awry.<br>
Then we had to backtrack to the cause.<br></blockquote><div><br></div><div>It sounds like the caller passed in a pbs_in but it was left uninitialized; or pointing at NULL.</div><div>The former shouldn't have happened - be defensive always scrub the parameters.</div><div><br></div><div><br></div><div> </div></div></div>