On Sat, Dec 18, 2021 at 1:49 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Thu, Dec 16, 2021 at 4:32 PM Hao Luo <haoluo@xxxxxxxxxx> wrote: > > > > Some helper functions may modify its arguments, for example, > > bpf_d_path, bpf_get_stack etc. Previously, their argument types > > were marked as ARG_PTR_TO_MEM, which is compatible with read-only > > mem types, such as PTR_TO_RDONLY_BUF. Therefore it's legitimate > > to modify a read-only memory by passing it into one of such helper > > functions. > > I've added ", but technically incorrect" to the above sentence. > Otherwise it sounds like it was an ok thing to do. > I've considered adding a set of Fixes tag, but there would be too many > and it's a laborious task to look through all such helpers just > to beautify the commit log. This patch set isn't going to > be backported anyway due to complexity. > > Please add a test to make sure that bpf_d_path on rdonly buf > is rejected. > Done. Just sent out a selftest patch for that. > Thank you very much for doing this work. > It's a great improvement to the verifier type handling. > No problem. I'm really glad to help there. :) > There is a concern that generality of flags may cause > a regression, but no amount of code review will reveal that. > Please watch out for strange verifier issues. Sure thing.