Merge 05cc42d601
("netfilter: ip6t_rpfilter: Fix regression with VRF interfaces") into android12-5.10-lts
Steps on the way to 5.10.227 Change-Id: I4384ca5cd2e6994725dc962097643972212adf37 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
b585ecc2c9
@ -149,7 +149,7 @@ static vm_fault_t nouveau_dmem_fault_copy_one(struct nouveau_drm *drm,
|
||||
if (!spage || !(args->src[0] & MIGRATE_PFN_MIGRATE))
|
||||
return 0;
|
||||
|
||||
dpage = alloc_page_vma(GFP_HIGHUSER, vmf->vma, vmf->address);
|
||||
dpage = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vmf->vma, vmf->address);
|
||||
if (!dpage)
|
||||
return VM_FAULT_SIGBUS;
|
||||
lock_page(dpage);
|
||||
|
@ -630,7 +630,7 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data,
|
||||
const struct firmware *fw,
|
||||
const struct shim_fw_info fw_info)
|
||||
{
|
||||
int rv;
|
||||
int rv = 0;
|
||||
void *dma_buf;
|
||||
dma_addr_t dma_buf_phy;
|
||||
u32 fragment_offset, fragment_size, payload_max_size;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/mii.h>
|
||||
#include <linux/phy.h>
|
||||
@ -819,6 +820,8 @@ static void lan9303_handle_reset(struct lan9303 *chip)
|
||||
if (!chip->reset_gpio)
|
||||
return;
|
||||
|
||||
gpiod_set_value_cansleep(chip->reset_gpio, 1);
|
||||
|
||||
if (chip->reset_duration != 0)
|
||||
msleep(chip->reset_duration);
|
||||
|
||||
@ -844,8 +847,34 @@ static int lan9303_disable_processing(struct lan9303 *chip)
|
||||
static int lan9303_check_device(struct lan9303 *chip)
|
||||
{
|
||||
int ret;
|
||||
int err;
|
||||
u32 reg;
|
||||
|
||||
/* In I2C-managed configurations this polling loop will clash with
|
||||
* switch's reading of EEPROM right after reset and this behaviour is
|
||||
* not configurable. While lan9303_read() already has quite long retry
|
||||
* timeout, seems not all cases are being detected as arbitration error.
|
||||
*
|
||||
* According to datasheet, EEPROM loader has 30ms timeout (in case of
|
||||
* missing EEPROM).
|
||||
*
|
||||
* Loading of the largest supported EEPROM is expected to take at least
|
||||
* 5.9s.
|
||||
*/
|
||||
err = read_poll_timeout(lan9303_read, ret,
|
||||
!ret && reg & LAN9303_HW_CFG_READY,
|
||||
20000, 6000000, false,
|
||||
chip->regmap, LAN9303_HW_CFG, ®);
|
||||
if (ret) {
|
||||
dev_err(chip->dev, "failed to read HW_CFG reg: %pe\n",
|
||||
ERR_PTR(ret));
|
||||
return ret;
|
||||
}
|
||||
if (err) {
|
||||
dev_err(chip->dev, "HW_CFG not ready: 0x%08x\n", reg);
|
||||
return err;
|
||||
}
|
||||
|
||||
ret = lan9303_read(chip->regmap, LAN9303_CHIP_REV, ®);
|
||||
if (ret) {
|
||||
dev_err(chip->dev, "failed to read chip revision register: %d\n",
|
||||
|
@ -422,7 +422,7 @@ mlxsw_sp_span_gretap4_route(const struct net_device *to_dev,
|
||||
|
||||
parms = mlxsw_sp_ipip_netdev_parms4(to_dev);
|
||||
ip_tunnel_init_flow(&fl4, parms.iph.protocol, *daddrp, *saddrp,
|
||||
0, 0, parms.link, tun->fwmark, 0);
|
||||
0, 0, dev_net(to_dev), parms.link, tun->fwmark, 0);
|
||||
|
||||
rt = ip_route_output_key(tun->net, &fl4);
|
||||
if (IS_ERR(rt))
|
||||
|
@ -1263,6 +1263,7 @@ static void geneve_setup(struct net_device *dev)
|
||||
}
|
||||
|
||||
static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = {
|
||||
[IFLA_GENEVE_UNSPEC] = { .strict_start_type = IFLA_GENEVE_INNER_PROTO_INHERIT },
|
||||
[IFLA_GENEVE_ID] = { .type = NLA_U32 },
|
||||
[IFLA_GENEVE_REMOTE] = { .len = sizeof_field(struct iphdr, daddr) },
|
||||
[IFLA_GENEVE_REMOTE6] = { .len = sizeof(struct in6_addr) },
|
||||
@ -1276,6 +1277,7 @@ static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = {
|
||||
[IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = { .type = NLA_U8 },
|
||||
[IFLA_GENEVE_TTL_INHERIT] = { .type = NLA_U8 },
|
||||
[IFLA_GENEVE_DF] = { .type = NLA_U8 },
|
||||
[IFLA_GENEVE_INNER_PROTO_INHERIT] = { .type = NLA_FLAG },
|
||||
};
|
||||
|
||||
static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
|
||||
@ -1781,6 +1783,7 @@ static size_t geneve_get_size(const struct net_device *dev)
|
||||
nla_total_size(sizeof(__u8)) + /* IFLA_GENEVE_UDP_ZERO_CSUM6_TX */
|
||||
nla_total_size(sizeof(__u8)) + /* IFLA_GENEVE_UDP_ZERO_CSUM6_RX */
|
||||
nla_total_size(sizeof(__u8)) + /* IFLA_GENEVE_TTL_INHERIT */
|
||||
nla_total_size(0) + /* IFLA_GENEVE_INNER_PROTO_INHERIT */
|
||||
0;
|
||||
}
|
||||
|
||||
|
@ -1337,8 +1337,8 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
|
||||
|
||||
/* loopback, multicast & non-ND link-local traffic; do not push through
|
||||
* packet taps again. Reset pkt_type for upper layers to process skb.
|
||||
* For strict packets with a source LLA, determine the dst using the
|
||||
* original ifindex.
|
||||
* For non-loopback strict packets, determine the dst using the original
|
||||
* ifindex.
|
||||
*/
|
||||
if (skb->pkt_type == PACKET_LOOPBACK || (need_strict && !is_ndisc)) {
|
||||
skb->dev = vrf_dev;
|
||||
@ -1347,7 +1347,7 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
|
||||
|
||||
if (skb->pkt_type == PACKET_LOOPBACK)
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
else if (ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)
|
||||
else
|
||||
vrf_ip6_input_dst(skb, vrf_dev, orig_iif);
|
||||
|
||||
goto out;
|
||||
|
@ -458,6 +458,7 @@ static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length)
|
||||
int dwc3_event_buffers_setup(struct dwc3 *dwc)
|
||||
{
|
||||
struct dwc3_event_buffer *evt;
|
||||
u32 reg;
|
||||
|
||||
if (!dwc->ev_buf)
|
||||
return 0;
|
||||
@ -470,8 +471,10 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc)
|
||||
upper_32_bits(evt->dma));
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0),
|
||||
DWC3_GEVNTSIZ_SIZE(evt->length));
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0);
|
||||
|
||||
/* Clear any stale event */
|
||||
reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -498,7 +501,10 @@ void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(0), 0);
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), DWC3_GEVNTSIZ_INTMASK
|
||||
| DWC3_GEVNTSIZ_SIZE(0));
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0);
|
||||
|
||||
/* Clear any stale event */
|
||||
reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg);
|
||||
}
|
||||
|
||||
static int dwc3_alloc_scratch_buffers(struct dwc3 *dwc)
|
||||
@ -1936,7 +1942,11 @@ static int dwc3_runtime_resume(struct device *dev)
|
||||
|
||||
switch (dwc->current_dr_role) {
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
dwc3_gadget_process_pending_events(dwc);
|
||||
if (dwc->pending_events) {
|
||||
pm_runtime_put(dwc->dev);
|
||||
dwc->pending_events = false;
|
||||
enable_irq(dwc->irq_gadget);
|
||||
}
|
||||
break;
|
||||
case DWC3_GCTL_PRTCAP_HOST:
|
||||
default:
|
||||
@ -2023,6 +2033,12 @@ static void dwc3_complete(struct device *dev)
|
||||
static const struct dev_pm_ops dwc3_dev_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume)
|
||||
.complete = dwc3_complete,
|
||||
|
||||
/*
|
||||
* Runtime suspend halts the controller on disconnection. It relies on
|
||||
* platforms with custom connection notification to start the controller
|
||||
* again.
|
||||
*/
|
||||
SET_RUNTIME_PM_OPS(dwc3_runtime_suspend, dwc3_runtime_resume,
|
||||
dwc3_runtime_idle)
|
||||
};
|
||||
|
@ -1621,7 +1621,6 @@ static inline void dwc3_otg_host_init(struct dwc3 *dwc)
|
||||
#if !IS_ENABLED(CONFIG_USB_DWC3_HOST)
|
||||
int dwc3_gadget_suspend(struct dwc3 *dwc);
|
||||
int dwc3_gadget_resume(struct dwc3 *dwc);
|
||||
void dwc3_gadget_process_pending_events(struct dwc3 *dwc);
|
||||
#else
|
||||
static inline int dwc3_gadget_suspend(struct dwc3 *dwc)
|
||||
{
|
||||
@ -1633,9 +1632,6 @@ static inline int dwc3_gadget_resume(struct dwc3 *dwc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
|
||||
{
|
||||
}
|
||||
#endif /* !IS_ENABLED(CONFIG_USB_DWC3_HOST) */
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_DWC3_ULPI)
|
||||
|
@ -4641,14 +4641,3 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
|
||||
err0:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
|
||||
{
|
||||
if (dwc->pending_events) {
|
||||
dwc3_interrupt(dwc->irq_gadget, dwc->ev_buf);
|
||||
dwc3_thread_interrupt(dwc->irq_gadget, dwc->ev_buf);
|
||||
pm_runtime_put(dwc->dev);
|
||||
dwc->pending_events = false;
|
||||
enable_irq(dwc->irq_gadget);
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@
|
||||
#define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
|
||||
#define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242
|
||||
#define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142
|
||||
#define PCI_DEVICE_ID_ASMEDIA_3042_XHCI 0x3042
|
||||
#define PCI_DEVICE_ID_ASMEDIA_3242_XHCI 0x3242
|
||||
|
||||
static const char hcd_name[] = "xhci_hcd";
|
||||
@ -321,6 +322,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
|
||||
xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||||
pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
|
||||
xhci->quirks |= XHCI_RESET_ON_RESUME;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
|
||||
xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
|
||||
|
||||
|
@ -2412,6 +2412,17 @@ UNUSUAL_DEV( 0xc251, 0x4003, 0x0100, 0x0100,
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_NOT_LOCKABLE),
|
||||
|
||||
/*
|
||||
* Reported by Icenowy Zheng <uwu@icenowy.me>
|
||||
* This is an interface for vendor-specific cryptic commands instead
|
||||
* of real USB storage device.
|
||||
*/
|
||||
UNUSUAL_DEV( 0xe5b7, 0x0811, 0x0100, 0x0100,
|
||||
"ZhuHai JieLi Technology",
|
||||
"JieLi BR21",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_IGNORE_DEVICE),
|
||||
|
||||
/* Reported by Andrew Simmons <andrew.simmons@gmail.com> */
|
||||
UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001,
|
||||
"DataStor",
|
||||
|
@ -240,11 +240,18 @@ static inline __be32 tunnel_id_to_key32(__be64 tun_id)
|
||||
static inline void ip_tunnel_init_flow(struct flowi4 *fl4,
|
||||
int proto,
|
||||
__be32 daddr, __be32 saddr,
|
||||
__be32 key, __u8 tos, int oif,
|
||||
__be32 key, __u8 tos,
|
||||
struct net *net, int oif,
|
||||
__u32 mark, __u32 tun_inner_hash)
|
||||
{
|
||||
memset(fl4, 0, sizeof(*fl4));
|
||||
fl4->flowi4_oif = oif;
|
||||
|
||||
if (oif) {
|
||||
fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index_rcu(net, oif);
|
||||
/* Legacy VRF/l3mdev use case */
|
||||
fl4->flowi4_oif = fl4->flowi4_l3mdev ? 0 : oif;
|
||||
}
|
||||
|
||||
fl4->daddr = daddr;
|
||||
fl4->saddr = saddr;
|
||||
fl4->flowi4_tos = tos;
|
||||
|
@ -853,6 +853,8 @@ static inline void sk_add_bind_node(struct sock *sk,
|
||||
hlist_for_each_entry_safe(__sk, tmp, list, sk_node)
|
||||
#define sk_for_each_bound(__sk, list) \
|
||||
hlist_for_each_entry(__sk, list, sk_bind_node)
|
||||
#define sk_for_each_bound_safe(__sk, tmp, list) \
|
||||
hlist_for_each_entry_safe(__sk, tmp, list, sk_bind_node)
|
||||
|
||||
/**
|
||||
* sk_for_each_entry_offset_rcu - iterate over a list at a given struct offset
|
||||
|
@ -608,8 +608,8 @@ static int gre_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
|
||||
key = &info->key;
|
||||
ip_tunnel_init_flow(&fl4, IPPROTO_GRE, key->u.ipv4.dst, key->u.ipv4.src,
|
||||
tunnel_id_to_key32(key->tun_id),
|
||||
key->tos & ~INET_ECN_MASK, 0, skb->mark,
|
||||
skb_get_hash(skb));
|
||||
key->tos & ~INET_ECN_MASK, dev_net(dev), 0,
|
||||
skb->mark, skb_get_hash(skb));
|
||||
rt = ip_route_output_key(dev_net(dev), &fl4);
|
||||
if (IS_ERR(rt))
|
||||
return PTR_ERR(rt);
|
||||
|
@ -294,8 +294,8 @@ static int ip_tunnel_bind_dev(struct net_device *dev)
|
||||
|
||||
ip_tunnel_init_flow(&fl4, iph->protocol, iph->daddr,
|
||||
iph->saddr, tunnel->parms.o_key,
|
||||
RT_TOS(iph->tos), tunnel->parms.link,
|
||||
tunnel->fwmark, 0);
|
||||
RT_TOS(iph->tos), dev_net(dev),
|
||||
tunnel->parms.link, tunnel->fwmark, 0);
|
||||
rt = ip_route_output_key(tunnel->net, &fl4);
|
||||
|
||||
if (!IS_ERR(rt)) {
|
||||
@ -584,7 +584,7 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||
}
|
||||
ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src,
|
||||
tunnel_id_to_key32(key->tun_id), RT_TOS(tos),
|
||||
0, skb->mark, skb_get_hash(skb));
|
||||
dev_net(dev), 0, skb->mark, skb_get_hash(skb));
|
||||
if (tunnel->encap.type != TUNNEL_ENCAP_NONE)
|
||||
goto tx_error;
|
||||
|
||||
@ -740,7 +740,8 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||
}
|
||||
|
||||
ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr,
|
||||
tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
|
||||
tunnel->parms.o_key, RT_TOS(tos),
|
||||
dev_net(dev), tunnel->parms.link,
|
||||
tunnel->fwmark, skb_get_hash(skb));
|
||||
|
||||
if (ip_tunnel_encap(skb, tunnel, &protocol, &fl4) < 0)
|
||||
|
@ -72,7 +72,9 @@ static bool rpfilter_lookup_reverse6(struct net *net, const struct sk_buff *skb,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (rt->rt6i_idev->dev == dev || (flags & XT_RPFILTER_LOOSE))
|
||||
if (rt->rt6i_idev->dev == dev ||
|
||||
l3mdev_master_ifindex_rcu(rt->rt6i_idev->dev) == dev->ifindex ||
|
||||
(flags & XT_RPFILTER_LOOSE))
|
||||
ret = true;
|
||||
out:
|
||||
ip6_rt_put(rt);
|
||||
|
@ -163,6 +163,7 @@ seg6_lookup_any_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
|
||||
struct flowi6 fl6;
|
||||
int dev_flags = 0;
|
||||
|
||||
memset(&fl6, 0, sizeof(fl6));
|
||||
fl6.flowi6_iif = skb->dev->ifindex;
|
||||
fl6.daddr = nhaddr ? *nhaddr : hdr->daddr;
|
||||
fl6.saddr = hdr->saddr;
|
||||
|
@ -2155,8 +2155,9 @@ void __netlink_clear_multicast_users(struct sock *ksk, unsigned int group)
|
||||
{
|
||||
struct sock *sk;
|
||||
struct netlink_table *tbl = &nl_table[ksk->sk_protocol];
|
||||
struct hlist_node *tmp;
|
||||
|
||||
sk_for_each_bound(sk, &tbl->mc_list)
|
||||
sk_for_each_bound_safe(sk, tmp, &tbl->mc_list)
|
||||
netlink_update_socket_mc(nlk_sk(sk), group, 0);
|
||||
}
|
||||
|
||||
|
@ -2602,12 +2602,14 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
|
||||
|
||||
if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
|
||||
__u32 mark = 0;
|
||||
int oif;
|
||||
|
||||
if (xfrm[i]->props.smark.v || xfrm[i]->props.smark.m)
|
||||
mark = xfrm_smark_get(fl->flowi_mark, xfrm[i]);
|
||||
|
||||
family = xfrm[i]->props.family;
|
||||
dst = xfrm_dst_lookup(xfrm[i], tos, fl->flowi_oif,
|
||||
oif = fl->flowi_oif ? : fl->flowi_l3mdev;
|
||||
dst = xfrm_dst_lookup(xfrm[i], tos, oif,
|
||||
&saddr, &daddr, family, mark);
|
||||
err = PTR_ERR(dst);
|
||||
if (IS_ERR(dst))
|
||||
|
Loading…
Reference in New Issue
Block a user