Skip to content

Commit

Permalink
Merge 4.9.315 into android-4.9-q
Browse files Browse the repository at this point in the history
Changes in 4.9.315
	net: Fix features skip in for_each_netdev_feature()
	ipv4: drop dst in multicast routing path
	netlink: do not reset transport header in netlink_recvmsg()
	mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection
	s390/ctcm: fix variable dereferenced before check
	s390/ctcm: fix potential memory leak
	s390/lcs: fix variable dereferenced before check
	net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe()
	hwmon: (f71882fg) Fix negative temperature
	ASoC: max98090: Reject invalid values in custom control put()
	ASoC: max98090: Generate notifications on changes for custom control
	ASoC: ops: Validate input values in snd_soc_put_volsw_range()
	usb: cdc-wdm: fix reading stuck on device close
	USB: serial: pl2303: add device id for HP LM930 Display
	USB: serial: qcserial: add support for Sierra Wireless EM7590
	USB: serial: option: add Fibocom L610 modem
	USB: serial: option: add Fibocom MA510 modem
	ping: fix address binding wrt vrf
	tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe()
	Linux 4.9.315

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I5f5db74e3544c572d998c8c0fc1a107acea692f4
  • Loading branch information
gregkh committed May 18, 2022
2 parents 34f36f2 + fa4ad01 commit 41d9243
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 314
SUBLEVEL = 315
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
5 changes: 3 additions & 2 deletions drivers/hwmon/f71882fg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,8 +1590,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
temp *= 125;
if (sign)
temp -= 128000;
} else
temp = data->temp[nr] * 1000;
} else {
temp = ((s8)data->temp[nr]) * 1000;
}

return sprintf(buf, "%d\n", temp);
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/sfc/ef10.c
Original file line number Diff line number Diff line change
Expand Up @@ -5197,6 +5197,11 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx)
n_parts++;
}

if (!n_parts) {
kfree(parts);
return 0;
}

rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
fail:
if (rc)
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1987,18 +1987,21 @@ static void hw_scan_work(struct work_struct *work)
memcpy(skb_put(probe, req->ie_len), req->ie,
req->ie_len);

rcu_read_lock();
if (!ieee80211_tx_prepare_skb(hwsim->hw,
hwsim->hw_scan_vif,
probe,
hwsim->tmp_chan->band,
NULL)) {
rcu_read_unlock();
kfree_skb(probe);
continue;
}

local_bh_disable();
mac80211_hwsim_tx_frame(hwsim->hw, probe,
hwsim->tmp_chan);
rcu_read_unlock();
local_bh_enable();
}
}
Expand Down
6 changes: 1 addition & 5 deletions drivers/s390/net/ctcm_mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,6 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
ctcm_clear_busy_do(dev);
}

kfree(mpcginfo);

return;

}
Expand Down Expand Up @@ -1205,10 +1203,10 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
CTCM_FUNTAIL, dev->name);
priv->stats.rx_dropped++;
/* mpcginfo only used for non-data transfers */
kfree(mpcginfo);
if (do_debug_data)
ctcmpc_dump_skb(pskb, -8);
}
kfree(mpcginfo);
}
done:

Expand Down Expand Up @@ -1998,7 +1996,6 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg)
}
break;
}
kfree(mpcginfo);

CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n",
__func__, ch->id, grp->outstanding_xid2,
Expand Down Expand Up @@ -2059,7 +2056,6 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg)
mpc_validate_xid(mpcginfo);
break;
}
kfree(mpcginfo);
return;
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/s390/net/ctcm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ static ssize_t ctcm_buffer_write(struct device *dev,
struct ctcm_priv *priv = dev_get_drvdata(dev);
int rc;

ndev = priv->channel[CTCM_READ]->netdev;
if (!(priv && priv->channel[CTCM_READ] && ndev)) {
if (!(priv && priv->channel[CTCM_READ] &&
priv->channel[CTCM_READ]->netdev)) {
CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev");
return -ENODEV;
}
ndev = priv->channel[CTCM_READ]->netdev;

rc = kstrtouint(buf, 0, &bs1);
if (rc)
Expand Down
7 changes: 4 additions & 3 deletions drivers/s390/net/lcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,10 +1761,11 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
lcs_schedule_recovery(card);
break;
case LCS_CMD_STOPLAN:
pr_warn("Stoplan for %s initiated by LGW\n",
card->dev->name);
if (card->dev)
if (card->dev) {
pr_warn("Stoplan for %s initiated by LGW\n",
card->dev->name);
netif_carrier_off(card->dev);
}
break;
default:
LCS_DBF_TEXT(5, trace, "noLGWcmd");
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/digicolor-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ static int digicolor_uart_probe(struct platform_device *pdev)
return PTR_ERR(uart_clk);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dp->port.mapbase = res->start;
dp->port.membase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dp->port.membase))
return PTR_ERR(dp->port.membase);
dp->port.mapbase = res->start;

irq = platform_get_irq(pdev, 0);
if (irq < 0)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ static int wdm_release(struct inode *inode, struct file *file)
kill_urbs(desc);
spin_lock_irq(&desc->iuspin);
desc->resp_count = 0;
clear_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irq(&desc->iuspin);
desc->manage_power(desc->intf, 0);
} else {
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,10 +2101,14 @@ static const struct usb_device_id option_ids[] = {
.driver_info = RSVD(3) },
{ USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */
.driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
{ USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */
{ USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
.driver_info = RSVD(4) | RSVD(5) },
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
.driver_info = RSVD(6) },
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0106, 0xff) }, /* Fibocom MA510 (ECM mode w/ diag intf.) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LM930_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) },
{ USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/pl2303.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
#define HP_TD620_PRODUCT_ID 0x0956
#define HP_LD960_PRODUCT_ID 0x0b39
#define HP_LD381_PRODUCT_ID 0x0f7f
#define HP_LM930_PRODUCT_ID 0x0f9b
#define HP_LCM220_PRODUCT_ID 0x3139
#define HP_LCM960_PRODUCT_ID 0x3239
#define HP_LD220_PRODUCT_ID 0x3524
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/serial/qcserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ static const struct usb_device_id id_table[] = {
{DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
{DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
{DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */
{DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */
{DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */
{DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
{DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
{DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
Expand Down
4 changes: 2 additions & 2 deletions include/linux/netdev_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ enum {
#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
#define NETIF_F_HW_TC __NETIF_F(HW_TC)

/* Finds the next feature with the highest number of the range of start till 0.
/* Finds the next feature with the highest number of the range of start-1 till 0.
*/
static inline int find_next_netdev_feature(u64 feature, unsigned long start)
{
Expand All @@ -158,7 +158,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
for ((bit) = find_next_netdev_feature((mask_addr), \
NETDEV_FEATURE_COUNT); \
(bit) >= 0; \
(bit) = find_next_netdev_feature((mask_addr), (bit) - 1))
(bit) = find_next_netdev_feature((mask_addr), (bit)))

/* Features valid for ethtool to change */
/* = all defined minus driver/device-class-related */
Expand Down
12 changes: 11 additions & 1 deletion net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
struct net *net = sock_net(sk);
if (sk->sk_family == AF_INET) {
struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
u32 tb_id = RT_TABLE_LOCAL;
int chk_addr_ret;

if (addr_len < sizeof(*addr))
Expand All @@ -315,7 +316,8 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
pr_debug("ping_check_bind_addr(sk=%p,addr=%pI4,port=%d)\n",
sk, &addr->sin_addr.s_addr, ntohs(addr->sin_port));

chk_addr_ret = inet_addr_type(net, addr->sin_addr.s_addr);
tb_id = l3mdev_fib_table_by_index(net, sk->sk_bound_dev_if) ? : tb_id;
chk_addr_ret = inet_addr_type_table(net, addr->sin_addr.s_addr, tb_id);

if (addr->sin_addr.s_addr == htonl(INADDR_ANY))
chk_addr_ret = RTN_LOCAL;
Expand Down Expand Up @@ -357,6 +359,14 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
return -ENODEV;
}
}

if (!dev && sk->sk_bound_dev_if) {
dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
if (!dev) {
rcu_read_unlock();
return -ENODEV;
}
}
has_addr = pingv6_ops.ipv6_chk_addr(net, &addr->sin6_addr, dev,
scoped);
rcu_read_unlock();
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
#endif
RT_CACHE_STAT_INC(in_slow_mc);

skb_dst_drop(skb);
skb_dst_set(skb, &rth->dst);
return 0;

Expand Down
1 change: 0 additions & 1 deletion net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,6 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
copied = len;
}

skb_reset_transport_header(data_skb);
err = skb_copy_datagram_msg(data_skb, 0, msg, copied);

if (msg->msg_name) {
Expand Down
5 changes: 4 additions & 1 deletion sound/soc/codecs/max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,

val = (val >> mc->shift) & mask;

if (sel < 0 || sel > mc->max)
return -EINVAL;

*select = sel;

/* Setting a volume is only valid if it is already On */
Expand All @@ -433,7 +436,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
mask << mc->shift,
sel << mc->shift);

return 0;
return *select != val;
}

static const char *max98090_perf_pwr_text[] =
Expand Down
18 changes: 17 additions & 1 deletion sound/soc/soc-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert;
unsigned int val, val_mask;
int err, ret;
int err, ret, tmp;

tmp = ucontrol->value.integer.value[0];
if (tmp < 0)
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
if (tmp > mc->max - mc->min + 1)
return -EINVAL;

if (invert)
val = (max - ucontrol->value.integer.value[0]) & mask;
Expand All @@ -543,6 +551,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
ret = err;

if (snd_soc_volsw_is_stereo(mc)) {
tmp = ucontrol->value.integer.value[1];
if (tmp < 0)
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
if (tmp > mc->max - mc->min + 1)
return -EINVAL;

if (invert)
val = (max - ucontrol->value.integer.value[1]) & mask;
else
Expand Down

0 comments on commit 41d9243

Please sign in to comment.