diff options
37 files changed, 236 insertions, 172 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index abfaacaaf346..946166e13953 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
| @@ -2297,7 +2297,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms | |||
| 2297 | return; | 2297 | return; |
| 2298 | } | 2298 | } |
| 2299 | 2299 | ||
| 2300 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { | 2300 | if (!capable(CAP_SYS_ADMIN)) { |
| 2301 | retcode = ERR_PERM; | 2301 | retcode = ERR_PERM; |
| 2302 | goto fail; | 2302 | goto fail; |
| 2303 | } | 2303 | } |
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 1f23e048f077..08d9a207259a 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c | |||
| @@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) | |||
| 134 | { | 134 | { |
| 135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); | 135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); |
| 136 | 136 | ||
| 137 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) | 137 | if (!capable(CAP_SYS_ADMIN)) |
| 138 | return; | 138 | return; |
| 139 | 139 | ||
| 140 | spin_lock(&receiving_list_lock); | 140 | spin_lock(&receiving_list_lock); |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 793b00138275..3463b469e657 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
| @@ -2173,9 +2173,10 @@ re_arm: | |||
| 2173 | * received frames (loopback). Since only the payload is given to this | 2173 | * received frames (loopback). Since only the payload is given to this |
| 2174 | * function, it check for loopback. | 2174 | * function, it check for loopback. |
| 2175 | */ | 2175 | */ |
| 2176 | static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) | 2176 | static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) |
| 2177 | { | 2177 | { |
| 2178 | struct port *port; | 2178 | struct port *port; |
| 2179 | int ret = RX_HANDLER_ANOTHER; | ||
| 2179 | 2180 | ||
| 2180 | if (length >= sizeof(struct lacpdu)) { | 2181 | if (length >= sizeof(struct lacpdu)) { |
| 2181 | 2182 | ||
| @@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
| 2184 | if (!port->slave) { | 2185 | if (!port->slave) { |
| 2185 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", | 2186 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", |
| 2186 | slave->dev->name, slave->dev->master->name); | 2187 | slave->dev->name, slave->dev->master->name); |
| 2187 | return; | 2188 | return ret; |
| 2188 | } | 2189 | } |
| 2189 | 2190 | ||
| 2190 | switch (lacpdu->subtype) { | 2191 | switch (lacpdu->subtype) { |
| 2191 | case AD_TYPE_LACPDU: | 2192 | case AD_TYPE_LACPDU: |
| 2193 | ret = RX_HANDLER_CONSUMED; | ||
| 2192 | pr_debug("Received LACPDU on port %d\n", | 2194 | pr_debug("Received LACPDU on port %d\n", |
| 2193 | port->actor_port_number); | 2195 | port->actor_port_number); |
| 2194 | /* Protect against concurrent state machines */ | 2196 | /* Protect against concurrent state machines */ |
| @@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
| 2198 | break; | 2200 | break; |
| 2199 | 2201 | ||
| 2200 | case AD_TYPE_MARKER: | 2202 | case AD_TYPE_MARKER: |
| 2203 | ret = RX_HANDLER_CONSUMED; | ||
| 2201 | // No need to convert fields to Little Endian since we don't use the marker's fields. | 2204 | // No need to convert fields to Little Endian since we don't use the marker's fields. |
| 2202 | 2205 | ||
| 2203 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2206 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
| @@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
| 2219 | } | 2222 | } |
| 2220 | } | 2223 | } |
| 2221 | } | 2224 | } |
| 2225 | return ret; | ||
| 2222 | } | 2226 | } |
| 2223 | 2227 | ||
| 2224 | /** | 2228 | /** |
| @@ -2456,18 +2460,20 @@ out: | |||
| 2456 | return NETDEV_TX_OK; | 2460 | return NETDEV_TX_OK; |
| 2457 | } | 2461 | } |
| 2458 | 2462 | ||
| 2459 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 2463 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
| 2460 | struct slave *slave) | 2464 | struct slave *slave) |
| 2461 | { | 2465 | { |
| 2466 | int ret = RX_HANDLER_ANOTHER; | ||
| 2462 | if (skb->protocol != PKT_TYPE_LACPDU) | 2467 | if (skb->protocol != PKT_TYPE_LACPDU) |
| 2463 | return; | 2468 | return ret; |
| 2464 | 2469 | ||
| 2465 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | 2470 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) |
| 2466 | return; | 2471 | return ret; |
| 2467 | 2472 | ||
| 2468 | read_lock(&bond->lock); | 2473 | read_lock(&bond->lock); |
| 2469 | bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); | 2474 | ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); |
| 2470 | read_unlock(&bond->lock); | 2475 | read_unlock(&bond->lock); |
| 2476 | return ret; | ||
| 2471 | } | 2477 | } |
| 2472 | 2478 | ||
| 2473 | /* | 2479 | /* |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 235b2cc58b28..5ee7e3c45db7 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
| @@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave); | |||
| 274 | void bond_3ad_handle_link_change(struct slave *slave, char link); | 274 | void bond_3ad_handle_link_change(struct slave *slave, char link); |
| 275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); | 275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); |
| 276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); | 276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); |
| 277 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 277 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
| 278 | struct slave *slave); | 278 | struct slave *slave); |
| 279 | int bond_3ad_set_carrier(struct bonding *bond); | 279 | int bond_3ad_set_carrier(struct bonding *bond); |
| 280 | void bond_3ad_update_lacp_rate(struct bonding *bond); | 280 | void bond_3ad_update_lacp_rate(struct bonding *bond); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 62d2409bb293..bc13b3d77432 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
| 1444 | struct sk_buff *skb = *pskb; | 1444 | struct sk_buff *skb = *pskb; |
| 1445 | struct slave *slave; | 1445 | struct slave *slave; |
| 1446 | struct bonding *bond; | 1446 | struct bonding *bond; |
| 1447 | void (*recv_probe)(struct sk_buff *, struct bonding *, | 1447 | int (*recv_probe)(struct sk_buff *, struct bonding *, |
| 1448 | struct slave *); | 1448 | struct slave *); |
| 1449 | int ret = RX_HANDLER_ANOTHER; | ||
| 1449 | 1450 | ||
| 1450 | skb = skb_share_check(skb, GFP_ATOMIC); | 1451 | skb = skb_share_check(skb, GFP_ATOMIC); |
| 1451 | if (unlikely(!skb)) | 1452 | if (unlikely(!skb)) |
| @@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
| 1464 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); | 1465 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); |
| 1465 | 1466 | ||
| 1466 | if (likely(nskb)) { | 1467 | if (likely(nskb)) { |
| 1467 | recv_probe(nskb, bond, slave); | ||
