Re: [net PATCH v1 2/2] net: netprio: fd passed in SCM_RIGHTSdatagram not set correctly

From: Al Viro
Date: Mon Aug 13 2012 - 22:31:27 EST


On Mon, Aug 13, 2012 at 06:39:45PM -0700, John Fastabend wrote:
> /* Bump the usage count and install the file. */
> get_file(fp[i]);
> fd_install(new_fd, fp[i]);
> + sock = sock_from_file(fp[i], &err);
> + if (sock)
> + sock->sk->sk_cgrp_prioidx = prioidx;

Better to do that before fd_install() exposes the sucker; it's not
a serious issue, but it's more obviously correct that way.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/