Re: [PATCH net v2 2/3] net: prevent rewrite of msg_name in sock_sendmsg()

From
Jordan Rife <hidden>
Date
2023-09-18 18:02:51
Reply to
Willem de Bruijn, 2023-09-18
Sounds like a plan.

On Mon, Sep 18, 2023 at 10:55 AM Willem de Bruijn
[off-list ref] wrote:
On Mon, Sep 18, 2023 at 1:52 PM Jordan Rife [off-list ref] wrote:
quoted
quoted
You used this short-hand to avoid having to update all callers to sock_sendmsg to __kernel_sendmsg?
Sorry about that, I misunderstood the intent. I'm fine with
introducing a new function, doing the address copy there, and
replacing all calls to sock_sendmsg with this wrapper. One thought on
the naming though,

To me the "__" prefix seems out of place for a function meant as a
public interface. Some possible alternatives:

1) Rename the current kernel_sendmsg() function to
kernel_sendmsg_kvec() and name  our new function kernel_sendmsg(). To
me this makes some sense, considering the new function is the more
generic of the two, and the existing kernel_sendmsg() specifically
accepts "struct kvec".
2) Same as #1, but drop the old kernel_sendmsg() function instead of
renaming it. Adapt all calls to the old kernel_sendmsg() to fit the
new kernel_sendmsg() (this amounts to adding a
iov_iter_kvec(&msg->msg_iter, ITER_SOURCE, vec, num, size); call in
each spot before kernel_sendmsg() is called.
Thanks. Fair points.

Of the two proposals, I think the first is preferable, as it avoids
some non-trivial open coding in multiple callers.
Thread (14 messages) 14 messages, 2 authors, last reply 2023-09-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help