You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[NETLINK]: Set correct pid for ioctl originating netlink events
This patch ensures that netlink events created as a result of programns using ioctls (such as ifconfig, route etc) contains the correct PID of those events. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
e431b8c004
commit
9ed19f339e
@@ -276,7 +276,7 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
|
||||
struct nlmsghdr *n, struct netlink_skb_parms *req)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
u32 pid = req ? req->pid : 0;
|
||||
u32 pid = req ? req->pid : n->nlmsg_pid;
|
||||
int size = NLMSG_SPACE(sizeof(struct rtmsg)+256);
|
||||
|
||||
skb = alloc_skb(size, GFP_KERNEL);
|
||||
@@ -1035,7 +1035,7 @@ fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
|
||||
}
|
||||
|
||||
nl->nlmsg_flags = NLM_F_REQUEST;
|
||||
nl->nlmsg_pid = 0;
|
||||
nl->nlmsg_pid = current->pid;
|
||||
nl->nlmsg_seq = 0;
|
||||
nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm));
|
||||
if (cmd == SIOCDELRT) {
|
||||
|
||||
Reference in New Issue
Block a user