Merge 5.10.59 into android12-5.10-lts
Changes in 5.10.59 KVM: SVM: Fix off-by-one indexing when nullifying last used SEV VMCB tee: Correct inappropriate usage of TEE_SHM_DMA_BUF flag firmware: tee_bnxt: Release TEE shm, session, and context during kexec bpf: Add lockdown check for probe_write_user helper Revert "selftests/resctrl: Use resctrl/info for feature detection" mm: make zone_to_nid() and zone_set_nid() available for DISCONTIGMEM arm64: dts: renesas: rzg2: Add usb2_clksel to RZ/G2 M/N/H arm64: dts: renesas: beacon: Fix USB extal reference arm64: dts: renesas: beacon: Fix USB ref clock references vboxsf: Honor excl flag to the dir-inode create op vboxsf: Make vboxsf_dir_create() return the handle for the created file USB:ehci:fix Kunpeng920 ehci hardware problem ALSA: pcm: Fix mmap breakage without explicit buffer setup ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 650 G8 Notebook PC ALSA: hda: Add quirk for ASUS Flow x13 ppp: Fix generating ppp unit id when ifname is not specified ovl: prevent private clone if bind mount is not allowed net: xilinx_emaclite: Do not print real IOMEM pointer Linux 5.10.59 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie4ba3880d1be4c29acc83453ad89a621ad046b7c
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
VERSION = 5
|
VERSION = 5
|
||||||
PATCHLEVEL = 10
|
PATCHLEVEL = 10
|
||||||
SUBLEVEL = 58
|
SUBLEVEL = 59
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = Dare mighty things
|
NAME = Dare mighty things
|
||||||
|
|
||||||
|
@@ -271,12 +271,12 @@
|
|||||||
&ehci0 {
|
&ehci0 {
|
||||||
dr_mode = "otg";
|
dr_mode = "otg";
|
||||||
status = "okay";
|
status = "okay";
|
||||||
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
|
||||||
};
|
};
|
||||||
|
|
||||||
&ehci1 {
|
&ehci1 {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
|
||||||
};
|
};
|
||||||
|
|
||||||
&hdmi0 {
|
&hdmi0 {
|
||||||
|
@@ -295,8 +295,10 @@
|
|||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usb_extal_clk {
|
&usb2_clksel {
|
||||||
clock-frequency = <50000000>;
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
|
||||||
|
<&versaclock5 3>, <&usb3s0_clk>;
|
||||||
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usb3s0_clk {
|
&usb3s0_clk {
|
||||||
|
@@ -836,6 +836,21 @@
|
|||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
usb2_clksel: clock-controller@e6590630 {
|
||||||
|
compatible = "renesas,r8a774a1-rcar-usb2-clock-sel",
|
||||||
|
"renesas,rcar-gen3-usb2-clock-sel";
|
||||||
|
reg = <0 0xe6590630 0 0x02>;
|
||||||
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
|
||||||
|
<&usb_extal_clk>, <&usb3s0_clk>;
|
||||||
|
clock-names = "ehci_ohci", "hs-usb-if",
|
||||||
|
"usb_extal", "usb_xtal";
|
||||||
|
#clock-cells = <0>;
|
||||||
|
power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
|
||||||
|
resets = <&cpg 703>, <&cpg 704>;
|
||||||
|
reset-names = "ehci_ohci", "hs-usb-if";
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
usb_dmac0: dma-controller@e65a0000 {
|
usb_dmac0: dma-controller@e65a0000 {
|
||||||
compatible = "renesas,r8a774a1-usb-dmac",
|
compatible = "renesas,r8a774a1-usb-dmac",
|
||||||
"renesas,usb-dmac";
|
"renesas,usb-dmac";
|
||||||
|
@@ -709,6 +709,21 @@
|
|||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
usb2_clksel: clock-controller@e6590630 {
|
||||||
|
compatible = "renesas,r8a774b1-rcar-usb2-clock-sel",
|
||||||
|
"renesas,rcar-gen3-usb2-clock-sel";
|
||||||
|
reg = <0 0xe6590630 0 0x02>;
|
||||||
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
|
||||||
|
<&usb_extal_clk>, <&usb3s0_clk>;
|
||||||
|
clock-names = "ehci_ohci", "hs-usb-if",
|
||||||
|
"usb_extal", "usb_xtal";
|
||||||
|
#clock-cells = <0>;
|
||||||
|
power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
|
||||||
|
resets = <&cpg 703>, <&cpg 704>;
|
||||||
|
reset-names = "ehci_ohci", "hs-usb-if";
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
usb_dmac0: dma-controller@e65a0000 {
|
usb_dmac0: dma-controller@e65a0000 {
|
||||||
compatible = "renesas,r8a774b1-usb-dmac",
|
compatible = "renesas,r8a774b1-usb-dmac",
|
||||||
"renesas,usb-dmac";
|
"renesas,usb-dmac";
|
||||||
|
@@ -890,6 +890,21 @@
|
|||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
usb2_clksel: clock-controller@e6590630 {
|
||||||
|
compatible = "renesas,r8a774e1-rcar-usb2-clock-sel",
|
||||||
|
"renesas,rcar-gen3-usb2-clock-sel";
|
||||||
|
reg = <0 0xe6590630 0 0x02>;
|
||||||
|
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
|
||||||
|
<&usb_extal_clk>, <&usb3s0_clk>;
|
||||||
|
clock-names = "ehci_ohci", "hs-usb-if",
|
||||||
|
"usb_extal", "usb_xtal";
|
||||||
|
#clock-cells = <0>;
|
||||||
|
power-domains = <&sysc R8A774E1_PD_ALWAYS_ON>;
|
||||||
|
resets = <&cpg 703>, <&cpg 704>;
|
||||||
|
reset-names = "ehci_ohci", "hs-usb-if";
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
usb_dmac0: dma-controller@e65a0000 {
|
usb_dmac0: dma-controller@e65a0000 {
|
||||||
compatible = "renesas,r8a774e1-usb-dmac",
|
compatible = "renesas,r8a774e1-usb-dmac",
|
||||||
"renesas,usb-dmac";
|
"renesas,usb-dmac";
|
||||||
|
@@ -124,7 +124,7 @@ static void sev_asid_free(int asid)
|
|||||||
|
|
||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
sd = per_cpu(svm_data, cpu);
|
sd = per_cpu(svm_data, cpu);
|
||||||
sd->sev_vmcbs[pos] = NULL;
|
sd->sev_vmcbs[asid] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&sev_bitmap_lock);
|
mutex_unlock(&sev_bitmap_lock);
|
||||||
|
@@ -212,10 +212,9 @@ static int tee_bnxt_fw_probe(struct device *dev)
|
|||||||
|
|
||||||
pvt_data.dev = dev;
|
pvt_data.dev = dev;
|
||||||
|
|
||||||
fw_shm_pool = tee_shm_alloc(pvt_data.ctx, MAX_SHM_MEM_SZ,
|
fw_shm_pool = tee_shm_alloc_kernel_buf(pvt_data.ctx, MAX_SHM_MEM_SZ);
|
||||||
TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
|
|
||||||
if (IS_ERR(fw_shm_pool)) {
|
if (IS_ERR(fw_shm_pool)) {
|
||||||
dev_err(pvt_data.dev, "tee_shm_alloc failed\n");
|
dev_err(pvt_data.dev, "tee_shm_alloc_kernel_buf failed\n");
|
||||||
err = PTR_ERR(fw_shm_pool);
|
err = PTR_ERR(fw_shm_pool);
|
||||||
goto out_sess;
|
goto out_sess;
|
||||||
}
|
}
|
||||||
@@ -242,6 +241,14 @@ static int tee_bnxt_fw_remove(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void tee_bnxt_fw_shutdown(struct device *dev)
|
||||||
|
{
|
||||||
|
tee_shm_free(pvt_data.fw_shm_pool);
|
||||||
|
tee_client_close_session(pvt_data.ctx, pvt_data.session_id);
|
||||||
|
tee_client_close_context(pvt_data.ctx);
|
||||||
|
pvt_data.ctx = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct tee_client_device_id tee_bnxt_fw_id_table[] = {
|
static const struct tee_client_device_id tee_bnxt_fw_id_table[] = {
|
||||||
{UUID_INIT(0x6272636D, 0x2019, 0x0716,
|
{UUID_INIT(0x6272636D, 0x2019, 0x0716,
|
||||||
0x42, 0x43, 0x4D, 0x5F, 0x53, 0x43, 0x48, 0x49)},
|
0x42, 0x43, 0x4D, 0x5F, 0x53, 0x43, 0x48, 0x49)},
|
||||||
@@ -257,6 +264,7 @@ static struct tee_client_driver tee_bnxt_fw_driver = {
|
|||||||
.bus = &tee_bus_type,
|
.bus = &tee_bus_type,
|
||||||
.probe = tee_bnxt_fw_probe,
|
.probe = tee_bnxt_fw_probe,
|
||||||
.remove = tee_bnxt_fw_remove,
|
.remove = tee_bnxt_fw_remove,
|
||||||
|
.shutdown = tee_bnxt_fw_shutdown,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1191,9 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dev_info(dev,
|
dev_info(dev,
|
||||||
"Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
|
"Xilinx EmacLite at 0x%08X mapped to 0x%p, irq=%d\n",
|
||||||
(unsigned int __force)ndev->mem_start,
|
(unsigned int __force)ndev->mem_start, lp->base_addr, ndev->irq);
|
||||||
(unsigned int __force)lp->base_addr, ndev->irq);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@@ -283,7 +283,7 @@ static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
|
|||||||
static int ppp_connect_channel(struct channel *pch, int unit);
|
static int ppp_connect_channel(struct channel *pch, int unit);
|
||||||
static int ppp_disconnect_channel(struct channel *pch);
|
static int ppp_disconnect_channel(struct channel *pch);
|
||||||
static void ppp_destroy_channel(struct channel *pch);
|
static void ppp_destroy_channel(struct channel *pch);
|
||||||
static int unit_get(struct idr *p, void *ptr);
|
static int unit_get(struct idr *p, void *ptr, int min);
|
||||||
static int unit_set(struct idr *p, void *ptr, int n);
|
static int unit_set(struct idr *p, void *ptr, int n);
|
||||||
static void unit_put(struct idr *p, int n);
|
static void unit_put(struct idr *p, int n);
|
||||||
static void *unit_find(struct idr *p, int n);
|
static void *unit_find(struct idr *p, int n);
|
||||||
@@ -1045,9 +1045,20 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
|
|||||||
mutex_lock(&pn->all_ppp_mutex);
|
mutex_lock(&pn->all_ppp_mutex);
|
||||||
|
|
||||||
if (unit < 0) {
|
if (unit < 0) {
|
||||||
ret = unit_get(&pn->units_idr, ppp);
|
ret = unit_get(&pn->units_idr, ppp, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
if (!ifname_is_set) {
|
||||||
|
while (1) {
|
||||||
|
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ret);
|
||||||
|
if (!__dev_get_by_name(ppp->ppp_net, ppp->dev->name))
|
||||||
|
break;
|
||||||
|
unit_put(&pn->units_idr, ret);
|
||||||
|
ret = unit_get(&pn->units_idr, ppp, ret + 1);
|
||||||
|
if (ret < 0)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Caller asked for a specific unit number. Fail with -EEXIST
|
/* Caller asked for a specific unit number. Fail with -EEXIST
|
||||||
* if unavailable. For backward compatibility, return -EEXIST
|
* if unavailable. For backward compatibility, return -EEXIST
|
||||||
@@ -3378,9 +3389,9 @@ static int unit_set(struct idr *p, void *ptr, int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get new free unit number and associate pointer with it */
|
/* get new free unit number and associate pointer with it */
|
||||||
static int unit_get(struct idr *p, void *ptr)
|
static int unit_get(struct idr *p, void *ptr, int min)
|
||||||
{
|
{
|
||||||
return idr_alloc(p, ptr, 0, 0, GFP_KERNEL);
|
return idr_alloc(p, ptr, min, 0, GFP_KERNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put unit number back to a pool */
|
/* put unit number back to a pool */
|
||||||
|
@@ -181,7 +181,7 @@ static struct tee_shm *get_msg_arg(struct tee_context *ctx, size_t num_params,
|
|||||||
struct optee_msg_arg *ma;
|
struct optee_msg_arg *ma;
|
||||||
|
|
||||||
shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params),
|
shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params),
|
||||||
TEE_SHM_MAPPED);
|
TEE_SHM_MAPPED | TEE_SHM_PRIV);
|
||||||
if (IS_ERR(shm))
|
if (IS_ERR(shm))
|
||||||
return shm;
|
return shm;
|
||||||
|
|
||||||
|
@@ -278,7 +278,8 @@ static void optee_release(struct tee_context *ctx)
|
|||||||
if (!ctxdata)
|
if (!ctxdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shm = tee_shm_alloc(ctx, sizeof(struct optee_msg_arg), TEE_SHM_MAPPED);
|
shm = tee_shm_alloc(ctx, sizeof(struct optee_msg_arg),
|
||||||
|
TEE_SHM_MAPPED | TEE_SHM_PRIV);
|
||||||
if (!IS_ERR(shm)) {
|
if (!IS_ERR(shm)) {
|
||||||
arg = tee_shm_get_va(shm, 0);
|
arg = tee_shm_get_va(shm, 0);
|
||||||
/*
|
/*
|
||||||
|
@@ -313,7 +313,7 @@ static void handle_rpc_func_cmd_shm_alloc(struct tee_context *ctx,
|
|||||||
shm = cmd_alloc_suppl(ctx, sz);
|
shm = cmd_alloc_suppl(ctx, sz);
|
||||||
break;
|
break;
|
||||||
case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
|
case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
|
||||||
shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED);
|
shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED | TEE_SHM_PRIV);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
arg->ret = TEEC_ERROR_BAD_PARAMETERS;
|
arg->ret = TEEC_ERROR_BAD_PARAMETERS;
|
||||||
@@ -501,7 +501,8 @@ void optee_handle_rpc(struct tee_context *ctx, struct optee_rpc_param *param,
|
|||||||
|
|
||||||
switch (OPTEE_SMC_RETURN_GET_RPC_FUNC(param->a0)) {
|
switch (OPTEE_SMC_RETURN_GET_RPC_FUNC(param->a0)) {
|
||||||
case OPTEE_SMC_RPC_FUNC_ALLOC:
|
case OPTEE_SMC_RPC_FUNC_ALLOC:
|
||||||
shm = tee_shm_alloc(ctx, param->a1, TEE_SHM_MAPPED);
|
shm = tee_shm_alloc(ctx, param->a1,
|
||||||
|
TEE_SHM_MAPPED | TEE_SHM_PRIV);
|
||||||
if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) {
|
if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) {
|
||||||
reg_pair_from_64(¶m->a1, ¶m->a2, pa);
|
reg_pair_from_64(¶m->a1, ¶m->a2, pa);
|
||||||
reg_pair_from_64(¶m->a4, ¶m->a5,
|
reg_pair_from_64(¶m->a4, ¶m->a5,
|
||||||
|
@@ -27,7 +27,11 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
|
|||||||
shm->paddr = page_to_phys(page);
|
shm->paddr = page_to_phys(page);
|
||||||
shm->size = PAGE_SIZE << order;
|
shm->size = PAGE_SIZE << order;
|
||||||
|
|
||||||
if (shm->flags & TEE_SHM_DMA_BUF) {
|
/*
|
||||||
|
* Shared memory private to the OP-TEE driver doesn't need
|
||||||
|
* to be registered with OP-TEE.
|
||||||
|
*/
|
||||||
|
if (!(shm->flags & TEE_SHM_PRIV)) {
|
||||||
unsigned int nr_pages = 1 << order, i;
|
unsigned int nr_pages = 1 << order, i;
|
||||||
struct page **pages;
|
struct page **pages;
|
||||||
|
|
||||||
@@ -60,7 +64,7 @@ err:
|
|||||||
static void pool_op_free(struct tee_shm_pool_mgr *poolm,
|
static void pool_op_free(struct tee_shm_pool_mgr *poolm,
|
||||||
struct tee_shm *shm)
|
struct tee_shm *shm)
|
||||||
{
|
{
|
||||||
if (shm->flags & TEE_SHM_DMA_BUF)
|
if (!(shm->flags & TEE_SHM_PRIV))
|
||||||
optee_shm_unregister(shm->ctx, shm);
|
optee_shm_unregister(shm->ctx, shm);
|
||||||
|
|
||||||
free_pages((unsigned long)shm->kaddr, get_order(shm->size));
|
free_pages((unsigned long)shm->kaddr, get_order(shm->size));
|
||||||
|
@@ -117,7 +117,7 @@ struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags)
|
|||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & ~(TEE_SHM_MAPPED | TEE_SHM_DMA_BUF))) {
|
if ((flags & ~(TEE_SHM_MAPPED | TEE_SHM_DMA_BUF | TEE_SHM_PRIV))) {
|
||||||
dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags);
|
dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags);
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(tee_shm_alloc);
|
|||||||
*/
|
*/
|
||||||
struct tee_shm *tee_shm_alloc_kernel_buf(struct tee_context *ctx, size_t size)
|
struct tee_shm *tee_shm_alloc_kernel_buf(struct tee_context *ctx, size_t size)
|
||||||
{
|
{
|
||||||
return tee_shm_alloc(ctx, size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
|
return tee_shm_alloc(ctx, size, TEE_SHM_MAPPED);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tee_shm_alloc_kernel_buf);
|
EXPORT_SYMBOL_GPL(tee_shm_alloc_kernel_buf);
|
||||||
|
|
||||||
|
@@ -297,6 +297,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
|
|||||||
if (pdev->vendor == PCI_VENDOR_ID_STMICRO
|
if (pdev->vendor == PCI_VENDOR_ID_STMICRO
|
||||||
&& pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
|
&& pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
|
||||||
; /* ConneXT has no sbrn register */
|
; /* ConneXT has no sbrn register */
|
||||||
|
else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
|
||||||
|
&& pdev->device == 0xa239)
|
||||||
|
; /* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
|
||||||
else
|
else
|
||||||
pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
|
pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
|
||||||
|
|
||||||
|
@@ -1919,6 +1919,20 @@ void drop_collected_mounts(struct vfsmount *mnt)
|
|||||||
namespace_unlock();
|
namespace_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
|
||||||
|
{
|
||||||
|
struct mount *child;
|
||||||
|
|
||||||
|
list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
|
||||||
|
if (!is_subdir(child->mnt_mountpoint, dentry))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (child->mnt.mnt_flags & MNT_LOCKED)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clone_private_mount - create a private clone of a path
|
* clone_private_mount - create a private clone of a path
|
||||||
*
|
*
|
||||||
@@ -1933,10 +1947,19 @@ struct vfsmount *clone_private_mount(const struct path *path)
|
|||||||
struct mount *old_mnt = real_mount(path->mnt);
|
struct mount *old_mnt = real_mount(path->mnt);
|
||||||
struct mount *new_mnt;
|
struct mount *new_mnt;
|
||||||
|
|
||||||
|
down_read(&namespace_sem);
|
||||||
if (IS_MNT_UNBINDABLE(old_mnt))
|
if (IS_MNT_UNBINDABLE(old_mnt))
|
||||||
return ERR_PTR(-EINVAL);
|
goto invalid;
|
||||||
|
|
||||||
|
if (!check_mnt(old_mnt))
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
|
if (has_locked_children(old_mnt, path->dentry))
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
||||||
|
up_read(&namespace_sem);
|
||||||
|
|
||||||
if (IS_ERR(new_mnt))
|
if (IS_ERR(new_mnt))
|
||||||
return ERR_CAST(new_mnt);
|
return ERR_CAST(new_mnt);
|
||||||
|
|
||||||
@@ -1944,6 +1967,10 @@ struct vfsmount *clone_private_mount(const struct path *path)
|
|||||||
new_mnt->mnt_ns = MNT_NS_INTERNAL;
|
new_mnt->mnt_ns = MNT_NS_INTERNAL;
|
||||||
|
|
||||||
return &new_mnt->mnt;
|
return &new_mnt->mnt;
|
||||||
|
|
||||||
|
invalid:
|
||||||
|
up_read(&namespace_sem);
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(clone_private_mount);
|
EXPORT_SYMBOL_GPL(clone_private_mount);
|
||||||
|
|
||||||
@@ -2295,19 +2322,6 @@ static int do_change_type(struct path *path, int ms_flags)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
|
|
||||||
{
|
|
||||||
struct mount *child;
|
|
||||||
list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
|
|
||||||
if (!is_subdir(child->mnt_mountpoint, dentry))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (child->mnt.mnt_flags & MNT_LOCKED)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct mount *__do_loopback(struct path *old_path, int recurse)
|
static struct mount *__do_loopback(struct path *old_path, int recurse)
|
||||||
{
|
{
|
||||||
struct mount *mnt = ERR_PTR(-EINVAL), *old = real_mount(old_path->mnt);
|
struct mount *mnt = ERR_PTR(-EINVAL), *old = real_mount(old_path->mnt);
|
||||||
|
@@ -253,7 +253,7 @@ static int vboxsf_dir_instantiate(struct inode *parent, struct dentry *dentry,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,
|
static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,
|
||||||
umode_t mode, int is_dir)
|
umode_t mode, bool is_dir, bool excl, u64 *handle_ret)
|
||||||
{
|
{
|
||||||
struct vboxsf_inode *sf_parent_i = VBOXSF_I(parent);
|
struct vboxsf_inode *sf_parent_i = VBOXSF_I(parent);
|
||||||
struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
|
struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
|
||||||
@@ -261,10 +261,12 @@ static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
params.handle = SHFL_HANDLE_NIL;
|
params.handle = SHFL_HANDLE_NIL;
|
||||||
params.create_flags = SHFL_CF_ACT_CREATE_IF_NEW |
|
params.create_flags = SHFL_CF_ACT_CREATE_IF_NEW | SHFL_CF_ACCESS_READWRITE;
|
||||||
SHFL_CF_ACT_FAIL_IF_EXISTS |
|
if (is_dir)
|
||||||
SHFL_CF_ACCESS_READWRITE |
|
params.create_flags |= SHFL_CF_DIRECTORY;
|
||||||
(is_dir ? SHFL_CF_DIRECTORY : 0);
|
if (excl)
|
||||||
|
params.create_flags |= SHFL_CF_ACT_FAIL_IF_EXISTS;
|
||||||
|
|
||||||
params.info.attr.mode = (mode & 0777) |
|
params.info.attr.mode = (mode & 0777) |
|
||||||
(is_dir ? SHFL_TYPE_DIRECTORY : SHFL_TYPE_FILE);
|
(is_dir ? SHFL_TYPE_DIRECTORY : SHFL_TYPE_FILE);
|
||||||
params.info.attr.additional = SHFLFSOBJATTRADD_NOTHING;
|
params.info.attr.additional = SHFLFSOBJATTRADD_NOTHING;
|
||||||
@@ -276,28 +278,32 @@ static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,
|
|||||||
if (params.result != SHFL_FILE_CREATED)
|
if (params.result != SHFL_FILE_CREATED)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
vboxsf_close(sbi->root, params.handle);
|
|
||||||
|
|
||||||
err = vboxsf_dir_instantiate(parent, dentry, ¶ms.info);
|
err = vboxsf_dir_instantiate(parent, dentry, ¶ms.info);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
goto out;
|
||||||
|
|
||||||
/* parent directory access/change time changed */
|
/* parent directory access/change time changed */
|
||||||
sf_parent_i->force_restat = 1;
|
sf_parent_i->force_restat = 1;
|
||||||
|
|
||||||
return 0;
|
out:
|
||||||
|
if (err == 0 && handle_ret)
|
||||||
|
*handle_ret = params.handle;
|
||||||
|
else
|
||||||
|
vboxsf_close(sbi->root, params.handle);
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vboxsf_dir_mkfile(struct inode *parent, struct dentry *dentry,
|
static int vboxsf_dir_mkfile(struct inode *parent, struct dentry *dentry,
|
||||||
umode_t mode, bool excl)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
return vboxsf_dir_create(parent, dentry, mode, 0);
|
return vboxsf_dir_create(parent, dentry, mode, false, excl, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vboxsf_dir_mkdir(struct inode *parent, struct dentry *dentry,
|
static int vboxsf_dir_mkdir(struct inode *parent, struct dentry *dentry,
|
||||||
umode_t mode)
|
umode_t mode)
|
||||||
{
|
{
|
||||||
return vboxsf_dir_create(parent, dentry, mode, 1);
|
return vboxsf_dir_create(parent, dentry, mode, true, true, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)
|
static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)
|
||||||
|
@@ -448,7 +448,7 @@ struct zone {
|
|||||||
*/
|
*/
|
||||||
long lowmem_reserve[MAX_NR_ZONES];
|
long lowmem_reserve[MAX_NR_ZONES];
|
||||||
|
|
||||||
#ifdef CONFIG_NUMA
|
#ifdef CONFIG_NEED_MULTIPLE_NODES
|
||||||
int node;
|
int node;
|
||||||
#endif
|
#endif
|
||||||
struct pglist_data *zone_pgdat;
|
struct pglist_data *zone_pgdat;
|
||||||
@@ -922,7 +922,7 @@ static inline bool populated_zone(struct zone *zone)
|
|||||||
return zone->present_pages;
|
return zone->present_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NUMA
|
#ifdef CONFIG_NEED_MULTIPLE_NODES
|
||||||
static inline int zone_to_nid(struct zone *zone)
|
static inline int zone_to_nid(struct zone *zone)
|
||||||
{
|
{
|
||||||
return zone->node;
|
return zone->node;
|
||||||
|
@@ -120,6 +120,7 @@ enum lockdown_reason {
|
|||||||
LOCKDOWN_MMIOTRACE,
|
LOCKDOWN_MMIOTRACE,
|
||||||
LOCKDOWN_DEBUGFS,
|
LOCKDOWN_DEBUGFS,
|
||||||
LOCKDOWN_XMON_WR,
|
LOCKDOWN_XMON_WR,
|
||||||
|
LOCKDOWN_BPF_WRITE_USER,
|
||||||
LOCKDOWN_INTEGRITY_MAX,
|
LOCKDOWN_INTEGRITY_MAX,
|
||||||
LOCKDOWN_KCORE,
|
LOCKDOWN_KCORE,
|
||||||
LOCKDOWN_KPROBES,
|
LOCKDOWN_KPROBES,
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#define TEE_SHM_USER_MAPPED BIT(4) /* Memory mapped in user space */
|
#define TEE_SHM_USER_MAPPED BIT(4) /* Memory mapped in user space */
|
||||||
#define TEE_SHM_POOL BIT(5) /* Memory allocated from pool */
|
#define TEE_SHM_POOL BIT(5) /* Memory allocated from pool */
|
||||||
#define TEE_SHM_KERNEL_MAPPED BIT(6) /* Memory mapped in kernel space */
|
#define TEE_SHM_KERNEL_MAPPED BIT(6) /* Memory mapped in kernel space */
|
||||||
|
#define TEE_SHM_PRIV BIT(7) /* Memory private to TEE driver */
|
||||||
|
|
||||||
struct device;
|
struct device;
|
||||||
struct tee_device;
|
struct tee_device;
|
||||||
|
@@ -1272,12 +1272,13 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
|
|||||||
return &bpf_get_numa_node_id_proto;
|
return &bpf_get_numa_node_id_proto;
|
||||||
case BPF_FUNC_perf_event_read:
|
case BPF_FUNC_perf_event_read:
|
||||||
return &bpf_perf_event_read_proto;
|
return &bpf_perf_event_read_proto;
|
||||||
case BPF_FUNC_probe_write_user:
|
|
||||||
return bpf_get_probe_write_proto();
|
|
||||||
case BPF_FUNC_current_task_under_cgroup:
|
case BPF_FUNC_current_task_under_cgroup:
|
||||||
return &bpf_current_task_under_cgroup_proto;
|
return &bpf_current_task_under_cgroup_proto;
|
||||||
case BPF_FUNC_get_prandom_u32:
|
case BPF_FUNC_get_prandom_u32:
|
||||||
return &bpf_get_prandom_u32_proto;
|
return &bpf_get_prandom_u32_proto;
|
||||||
|
case BPF_FUNC_probe_write_user:
|
||||||
|
return security_locked_down(LOCKDOWN_BPF_WRITE_USER) < 0 ?
|
||||||
|
NULL : bpf_get_probe_write_proto();
|
||||||
case BPF_FUNC_probe_read_user:
|
case BPF_FUNC_probe_read_user:
|
||||||
return &bpf_probe_read_user_proto;
|
return &bpf_probe_read_user_proto;
|
||||||
case BPF_FUNC_probe_read_kernel:
|
case BPF_FUNC_probe_read_kernel:
|
||||||
|
@@ -33,6 +33,7 @@ static const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
|
|||||||
[LOCKDOWN_MMIOTRACE] = "unsafe mmio",
|
[LOCKDOWN_MMIOTRACE] = "unsafe mmio",
|
||||||
[LOCKDOWN_DEBUGFS] = "debugfs access",
|
[LOCKDOWN_DEBUGFS] = "debugfs access",
|
||||||
[LOCKDOWN_XMON_WR] = "xmon write access",
|
[LOCKDOWN_XMON_WR] = "xmon write access",
|
||||||
|
[LOCKDOWN_BPF_WRITE_USER] = "use of bpf to write user RAM",
|
||||||
[LOCKDOWN_INTEGRITY_MAX] = "integrity",
|
[LOCKDOWN_INTEGRITY_MAX] = "integrity",
|
||||||
[LOCKDOWN_KCORE] = "/proc/kcore access",
|
[LOCKDOWN_KCORE] = "/proc/kcore access",
|
||||||
[LOCKDOWN_KPROBES] = "use of kprobes",
|
[LOCKDOWN_KPROBES] = "use of kprobes",
|
||||||
|
@@ -251,7 +251,10 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
|
|||||||
|
|
||||||
switch (substream->dma_buffer.dev.type) {
|
switch (substream->dma_buffer.dev.type) {
|
||||||
case SNDRV_DMA_TYPE_UNKNOWN:
|
case SNDRV_DMA_TYPE_UNKNOWN:
|
||||||
return false;
|
/* we can't know the device, so just assume that the driver does
|
||||||
|
* everything right
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
case SNDRV_DMA_TYPE_CONTINUOUS:
|
case SNDRV_DMA_TYPE_CONTINUOUS:
|
||||||
case SNDRV_DMA_TYPE_VMALLOC:
|
case SNDRV_DMA_TYPE_VMALLOC:
|
||||||
return true;
|
return true;
|
||||||
|
@@ -8357,6 +8357,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
|
SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
|
||||||
SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
|
SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
|
||||||
SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
|
SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
|
||||||
|
SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
|
||||||
SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
|
||||||
@@ -8389,6 +8390,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
|
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
|
SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
|
||||||
SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
|
SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
|
||||||
|
SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
|
SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
|
||||||
SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||||
SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||||
|
@@ -28,10 +28,6 @@
|
|||||||
#define RESCTRL_PATH "/sys/fs/resctrl"
|
#define RESCTRL_PATH "/sys/fs/resctrl"
|
||||||
#define PHYS_ID_PATH "/sys/devices/system/cpu/cpu"
|
#define PHYS_ID_PATH "/sys/devices/system/cpu/cpu"
|
||||||
#define CBM_MASK_PATH "/sys/fs/resctrl/info"
|
#define CBM_MASK_PATH "/sys/fs/resctrl/info"
|
||||||
#define L3_PATH "/sys/fs/resctrl/info/L3"
|
|
||||||
#define MB_PATH "/sys/fs/resctrl/info/MB"
|
|
||||||
#define L3_MON_PATH "/sys/fs/resctrl/info/L3_MON"
|
|
||||||
#define L3_MON_FEATURES_PATH "/sys/fs/resctrl/info/L3_MON/mon_features"
|
|
||||||
|
|
||||||
#define PARENT_EXIT(err_msg) \
|
#define PARENT_EXIT(err_msg) \
|
||||||
do { \
|
do { \
|
||||||
@@ -83,7 +79,7 @@ int remount_resctrlfs(bool mum_resctrlfs);
|
|||||||
int get_resource_id(int cpu_no, int *resource_id);
|
int get_resource_id(int cpu_no, int *resource_id);
|
||||||
int umount_resctrlfs(void);
|
int umount_resctrlfs(void);
|
||||||
int validate_bw_report_request(char *bw_report);
|
int validate_bw_report_request(char *bw_report);
|
||||||
bool validate_resctrl_feature_request(const char *resctrl_val);
|
bool validate_resctrl_feature_request(char *resctrl_val);
|
||||||
char *fgrep(FILE *inf, const char *str);
|
char *fgrep(FILE *inf, const char *str);
|
||||||
int taskset_benchmark(pid_t bm_pid, int cpu_no);
|
int taskset_benchmark(pid_t bm_pid, int cpu_no);
|
||||||
void run_benchmark(int signum, siginfo_t *info, void *ucontext);
|
void run_benchmark(int signum, siginfo_t *info, void *ucontext);
|
||||||
|
@@ -616,56 +616,26 @@ char *fgrep(FILE *inf, const char *str)
|
|||||||
* validate_resctrl_feature_request - Check if requested feature is valid.
|
* validate_resctrl_feature_request - Check if requested feature is valid.
|
||||||
* @resctrl_val: Requested feature
|
* @resctrl_val: Requested feature
|
||||||
*
|
*
|
||||||
* Return: True if the feature is supported, else false
|
* Return: 0 on success, non-zero on failure
|
||||||
*/
|
*/
|
||||||
bool validate_resctrl_feature_request(const char *resctrl_val)
|
bool validate_resctrl_feature_request(char *resctrl_val)
|
||||||
{
|
{
|
||||||
struct stat statbuf;
|
FILE *inf = fopen("/proc/cpuinfo", "r");
|
||||||
bool found = false;
|
bool found = false;
|
||||||
char *res;
|
char *res;
|
||||||
FILE *inf;
|
|
||||||
|
|
||||||
if (!resctrl_val)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (remount_resctrlfs(false))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) {
|
|
||||||
if (!stat(L3_PATH, &statbuf))
|
|
||||||
return true;
|
|
||||||
} else if (!strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR))) {
|
|
||||||
if (!stat(MB_PATH, &statbuf))
|
|
||||||
return true;
|
|
||||||
} else if (!strncmp(resctrl_val, MBM_STR, sizeof(MBM_STR)) ||
|
|
||||||
!strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR))) {
|
|
||||||
if (!stat(L3_MON_PATH, &statbuf)) {
|
|
||||||
inf = fopen(L3_MON_FEATURES_PATH, "r");
|
|
||||||
if (!inf)
|
if (!inf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR))) {
|
res = fgrep(inf, "flags");
|
||||||
res = fgrep(inf, "llc_occupancy");
|
|
||||||
if (res) {
|
|
||||||
found = true;
|
|
||||||
free(res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strncmp(resctrl_val, MBM_STR, sizeof(MBM_STR))) {
|
|
||||||
res = fgrep(inf, "mbm_total_bytes");
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
char *s = strchr(res, ':');
|
||||||
|
|
||||||
|
found = s && !strstr(s, resctrl_val);
|
||||||
free(res);
|
free(res);
|
||||||
res = fgrep(inf, "mbm_local_bytes");
|
|
||||||
if (res) {
|
|
||||||
found = true;
|
|
||||||
free(res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fclose(inf);
|
fclose(inf);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user