mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Merge 5.10.171 into android12-5.10-lts
Changes in 5.10.171 Fix XFRM-I support for nested ESP tunnels arm64: dts: rockchip: drop unused LED mode property from rk3328-roc-cc ARM: dts: rockchip: add power-domains property to dp node on rk3288 ACPI: NFIT: fix a potential deadlock during NFIT teardown btrfs: send: limit number of clones and allocated memory size IB/hfi1: Assign npages earlier neigh: make sure used and confirmed times are valid HID: core: Fix deadloop in hid_apply_multiplier. bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). vc_screen: don't clobber return value in vcs_read md: Flush workqueue md_rdev_misc_wq in md_alloc() scripts/tags.sh: Invoke 'realpath' via 'xargs' scripts/tags.sh: fix incompatibility with PCRE2 drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling USB: serial: option: add support for VW/Skoda "Carstick LTE" usb: gadget: u_serial: Add null pointer check in gserial_resume USB: core: Don't hold device lock while reading the "descriptors" sysfs file io_uring: add missing lock in io_get_file_fixed Linux 5.10.171 Change-Id: I4ffd5ae7f55bc0579b65c9cff91327ffd5194c2f Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
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 = 170
|
SUBLEVEL = 171
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = Dare mighty things
|
NAME = Dare mighty things
|
||||||
|
|
||||||
|
|||||||
@@ -1203,6 +1203,7 @@
|
|||||||
clock-names = "dp", "pclk";
|
clock-names = "dp", "pclk";
|
||||||
phys = <&edp_phy>;
|
phys = <&edp_phy>;
|
||||||
phy-names = "dp";
|
phy-names = "dp";
|
||||||
|
power-domains = <&power RK3288_PD_VIO>;
|
||||||
resets = <&cru SRST_EDP>;
|
resets = <&cru SRST_EDP>;
|
||||||
reset-names = "dp";
|
reset-names = "dp";
|
||||||
rockchip,grf = <&grf>;
|
rockchip,grf = <&grf>;
|
||||||
|
|||||||
@@ -91,7 +91,6 @@
|
|||||||
linux,default-trigger = "heartbeat";
|
linux,default-trigger = "heartbeat";
|
||||||
gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
|
gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
|
||||||
default-state = "on";
|
default-state = "on";
|
||||||
mode = <0x23>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
user_led: led-1 {
|
user_led: led-1 {
|
||||||
@@ -99,7 +98,6 @@
|
|||||||
linux,default-trigger = "mmc1";
|
linux,default-trigger = "mmc1";
|
||||||
gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
|
gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
|
||||||
default-state = "off";
|
default-state = "off";
|
||||||
mode = <0x05>;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3686,8 +3686,8 @@ void acpi_nfit_shutdown(void *data)
|
|||||||
|
|
||||||
mutex_lock(&acpi_desc->init_mutex);
|
mutex_lock(&acpi_desc->init_mutex);
|
||||||
set_bit(ARS_CANCEL, &acpi_desc->scrub_flags);
|
set_bit(ARS_CANCEL, &acpi_desc->scrub_flags);
|
||||||
cancel_delayed_work_sync(&acpi_desc->dwork);
|
|
||||||
mutex_unlock(&acpi_desc->init_mutex);
|
mutex_unlock(&acpi_desc->init_mutex);
|
||||||
|
cancel_delayed_work_sync(&acpi_desc->dwork);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Bounce the nvdimm bus lock to make sure any in-flight
|
* Bounce the nvdimm bus lock to make sure any in-flight
|
||||||
|
|||||||
@@ -157,9 +157,10 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev,
|
|||||||
* since virtio_gpu doesn't support dma-buf import from other devices.
|
* since virtio_gpu doesn't support dma-buf import from other devices.
|
||||||
*/
|
*/
|
||||||
shmem->pages = drm_gem_shmem_get_sg_table(&bo->base.base);
|
shmem->pages = drm_gem_shmem_get_sg_table(&bo->base.base);
|
||||||
if (!shmem->pages) {
|
if (IS_ERR(shmem->pages)) {
|
||||||
drm_gem_shmem_unpin(&bo->base.base);
|
drm_gem_shmem_unpin(&bo->base.base);
|
||||||
return -EINVAL;
|
shmem->pages = NULL;
|
||||||
|
return PTR_ERR(shmem->pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_dma_api) {
|
if (use_dma_api) {
|
||||||
|
|||||||
@@ -1197,6 +1197,7 @@ int hid_open_report(struct hid_device *device)
|
|||||||
__u8 *end;
|
__u8 *end;
|
||||||
__u8 *next;
|
__u8 *next;
|
||||||
int ret;
|
int ret;
|
||||||
|
int i;
|
||||||
static int (*dispatch_type[])(struct hid_parser *parser,
|
static int (*dispatch_type[])(struct hid_parser *parser,
|
||||||
struct hid_item *item) = {
|
struct hid_item *item) = {
|
||||||
hid_parser_main,
|
hid_parser_main,
|
||||||
@@ -1247,6 +1248,8 @@ int hid_open_report(struct hid_device *device)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
|
device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
|
||||||
|
for (i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++)
|
||||||
|
device->collection[i].parent_idx = -1;
|
||||||
|
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
while ((next = fetch_item(start, end, &item)) != NULL) {
|
while ((next = fetch_item(start, end, &item)) != NULL) {
|
||||||
|
|||||||
@@ -202,16 +202,11 @@ static void unpin_rcv_pages(struct hfi1_filedata *fd,
|
|||||||
static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
|
static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
|
||||||
{
|
{
|
||||||
int pinned;
|
int pinned;
|
||||||
unsigned int npages;
|
unsigned int npages = tidbuf->npages;
|
||||||
unsigned long vaddr = tidbuf->vaddr;
|
unsigned long vaddr = tidbuf->vaddr;
|
||||||
struct page **pages = NULL;
|
struct page **pages = NULL;
|
||||||
struct hfi1_devdata *dd = fd->uctxt->dd;
|
struct hfi1_devdata *dd = fd->uctxt->dd;
|
||||||
|
|
||||||
/* Get the number of pages the user buffer spans */
|
|
||||||
npages = num_user_pages(vaddr, tidbuf->length);
|
|
||||||
if (!npages)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
if (npages > fd->uctxt->expected_count) {
|
if (npages > fd->uctxt->expected_count) {
|
||||||
dd_dev_err(dd, "Expected buffer too big\n");
|
dd_dev_err(dd, "Expected buffer too big\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -238,7 +233,6 @@ static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
|
|||||||
return pinned;
|
return pinned;
|
||||||
}
|
}
|
||||||
tidbuf->pages = pages;
|
tidbuf->pages = pages;
|
||||||
tidbuf->npages = npages;
|
|
||||||
fd->tid_n_pinned += pinned;
|
fd->tid_n_pinned += pinned;
|
||||||
return pinned;
|
return pinned;
|
||||||
}
|
}
|
||||||
@@ -316,6 +310,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
|
|||||||
mutex_init(&tidbuf->cover_mutex);
|
mutex_init(&tidbuf->cover_mutex);
|
||||||
tidbuf->vaddr = tinfo->vaddr;
|
tidbuf->vaddr = tinfo->vaddr;
|
||||||
tidbuf->length = tinfo->length;
|
tidbuf->length = tinfo->length;
|
||||||
|
tidbuf->npages = num_user_pages(tidbuf->vaddr, tidbuf->length);
|
||||||
tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets),
|
tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tidbuf->psets) {
|
if (!tidbuf->psets) {
|
||||||
|
|||||||
@@ -5683,6 +5683,7 @@ static int md_alloc(dev_t dev, char *name)
|
|||||||
* completely removed (mddev_delayed_delete).
|
* completely removed (mddev_delayed_delete).
|
||||||
*/
|
*/
|
||||||
flush_workqueue(md_misc_wq);
|
flush_workqueue(md_misc_wq);
|
||||||
|
flush_workqueue(md_rdev_misc_wq);
|
||||||
|
|
||||||
mutex_lock(&disks_mutex);
|
mutex_lock(&disks_mutex);
|
||||||
error = -EEXIST;
|
error = -EEXIST;
|
||||||
|
|||||||
@@ -403,10 +403,11 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
|||||||
unsigned int this_round, skip = 0;
|
unsigned int this_round, skip = 0;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
ret = -ENXIO;
|
|
||||||
vc = vcs_vc(inode, &viewed);
|
vc = vcs_vc(inode, &viewed);
|
||||||
if (!vc)
|
if (!vc) {
|
||||||
goto unlock_out;
|
ret = -ENXIO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check whether we are above size each round,
|
/* Check whether we are above size each round,
|
||||||
* as copy_to_user at the end of this loop
|
* as copy_to_user at the end of this loop
|
||||||
|
|||||||
@@ -2380,9 +2380,8 @@ static int usb_enumerate_device_otg(struct usb_device *udev)
|
|||||||
* usb_enumerate_device - Read device configs/intfs/otg (usbcore-internal)
|
* usb_enumerate_device - Read device configs/intfs/otg (usbcore-internal)
|
||||||
* @udev: newly addressed device (in ADDRESS state)
|
* @udev: newly addressed device (in ADDRESS state)
|
||||||
*
|
*
|
||||||
* This is only called by usb_new_device() and usb_authorize_device()
|
* This is only called by usb_new_device() -- all comments that apply there
|
||||||
* and FIXME -- all comments that apply to them apply here wrt to
|
* apply here wrt to environment.
|
||||||
* environment.
|
|
||||||
*
|
*
|
||||||
* If the device is WUSB and not authorized, we don't attempt to read
|
* If the device is WUSB and not authorized, we don't attempt to read
|
||||||
* the string descriptors, as they will be errored out by the device
|
* the string descriptors, as they will be errored out by the device
|
||||||
|
|||||||
@@ -889,11 +889,7 @@ read_descriptors(struct file *filp, struct kobject *kobj,
|
|||||||
size_t srclen, n;
|
size_t srclen, n;
|
||||||
int cfgno;
|
int cfgno;
|
||||||
void *src;
|
void *src;
|
||||||
int retval;
|
|
||||||
|
|
||||||
retval = usb_lock_device_interruptible(udev);
|
|
||||||
if (retval < 0)
|
|
||||||
return -EINTR;
|
|
||||||
/* The binary attribute begins with the device descriptor.
|
/* The binary attribute begins with the device descriptor.
|
||||||
* Following that are the raw descriptor entries for all the
|
* Following that are the raw descriptor entries for all the
|
||||||
* configurations (config plus subsidiary descriptors).
|
* configurations (config plus subsidiary descriptors).
|
||||||
@@ -918,7 +914,6 @@ read_descriptors(struct file *filp, struct kobject *kobj,
|
|||||||
off -= srclen;
|
off -= srclen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usb_unlock_device(udev);
|
|
||||||
return count - nleft;
|
return count - nleft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,9 @@
|
|||||||
#define WRITE_BUF_SIZE 8192 /* TX only */
|
#define WRITE_BUF_SIZE 8192 /* TX only */
|
||||||
#define GS_CONSOLE_BUF_SIZE 8192
|
#define GS_CONSOLE_BUF_SIZE 8192
|
||||||
|
|
||||||
|
/* Prevents race conditions while accessing gser->ioport */
|
||||||
|
static DEFINE_SPINLOCK(serial_port_lock);
|
||||||
|
|
||||||
/* console info */
|
/* console info */
|
||||||
struct gs_console {
|
struct gs_console {
|
||||||
struct console console;
|
struct console console;
|
||||||
@@ -1374,8 +1377,10 @@ void gserial_disconnect(struct gserial *gser)
|
|||||||
if (!port)
|
if (!port)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&serial_port_lock, flags);
|
||||||
|
|
||||||
/* tell the TTY glue not to do I/O here any more */
|
/* tell the TTY glue not to do I/O here any more */
|
||||||
spin_lock_irqsave(&port->port_lock, flags);
|
spin_lock(&port->port_lock);
|
||||||
|
|
||||||
gs_console_disconnect(port);
|
gs_console_disconnect(port);
|
||||||
|
|
||||||
@@ -1390,7 +1395,8 @@ void gserial_disconnect(struct gserial *gser)
|
|||||||
tty_hangup(port->port.tty);
|
tty_hangup(port->port.tty);
|
||||||
}
|
}
|
||||||
port->suspended = false;
|
port->suspended = false;
|
||||||
spin_unlock_irqrestore(&port->port_lock, flags);
|
spin_unlock(&port->port_lock);
|
||||||
|
spin_unlock_irqrestore(&serial_port_lock, flags);
|
||||||
|
|
||||||
/* disable endpoints, aborting down any active I/O */
|
/* disable endpoints, aborting down any active I/O */
|
||||||
usb_ep_disable(gser->out);
|
usb_ep_disable(gser->out);
|
||||||
@@ -1424,10 +1430,19 @@ EXPORT_SYMBOL_GPL(gserial_suspend);
|
|||||||
|
|
||||||
void gserial_resume(struct gserial *gser)
|
void gserial_resume(struct gserial *gser)
|
||||||
{
|
{
|
||||||
struct gs_port *port = gser->ioport;
|
struct gs_port *port;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&port->port_lock, flags);
|
spin_lock_irqsave(&serial_port_lock, flags);
|
||||||
|
port = gser->ioport;
|
||||||
|
|
||||||
|
if (!port) {
|
||||||
|
spin_unlock_irqrestore(&serial_port_lock, flags);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock(&port->port_lock);
|
||||||
|
spin_unlock(&serial_port_lock);
|
||||||
port->suspended = false;
|
port->suspended = false;
|
||||||
if (!port->start_delayed) {
|
if (!port->start_delayed) {
|
||||||
spin_unlock_irqrestore(&port->port_lock, flags);
|
spin_unlock_irqrestore(&port->port_lock, flags);
|
||||||
|
|||||||
@@ -402,6 +402,8 @@ static void option_instat_callback(struct urb *urb);
|
|||||||
#define LONGCHEER_VENDOR_ID 0x1c9e
|
#define LONGCHEER_VENDOR_ID 0x1c9e
|
||||||
|
|
||||||
/* 4G Systems products */
|
/* 4G Systems products */
|
||||||
|
/* This one was sold as the VW and Skoda "Carstick LTE" */
|
||||||
|
#define FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE 0x7605
|
||||||
/* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
|
/* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
|
||||||
* It seems to contain a Qualcomm QSC6240/6290 chipset */
|
* It seems to contain a Qualcomm QSC6240/6290 chipset */
|
||||||
#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
|
#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
|
||||||
@@ -1976,6 +1978,8 @@ static const struct usb_device_id option_ids[] = {
|
|||||||
.driver_info = RSVD(2) },
|
.driver_info = RSVD(2) },
|
||||||
{ USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
|
{ USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
|
||||||
{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
|
{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
|
||||||
|
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE),
|
||||||
|
.driver_info = RSVD(0) },
|
||||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
|
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
|
||||||
.driver_info = NCTRL(0) | NCTRL(1) },
|
.driver_info = NCTRL(0) | NCTRL(1) },
|
||||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),
|
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),
|
||||||
|
|||||||
@@ -7276,10 +7276,10 @@ long btrfs_ioctl_send(struct file *mnt_file, struct btrfs_ioctl_send_args *arg)
|
|||||||
/*
|
/*
|
||||||
* Check that we don't overflow at later allocations, we request
|
* Check that we don't overflow at later allocations, we request
|
||||||
* clone_sources_count + 1 items, and compare to unsigned long inside
|
* clone_sources_count + 1 items, and compare to unsigned long inside
|
||||||
* access_ok.
|
* access_ok. Also set an upper limit for allocation size so this can't
|
||||||
|
* easily exhaust memory. Max number of clone sources is about 200K.
|
||||||
*/
|
*/
|
||||||
if (arg->clone_sources_count >
|
if (arg->clone_sources_count > SZ_8M / sizeof(struct clone_root)) {
|
||||||
ULONG_MAX / sizeof(struct clone_root) - 1) {
|
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1102,7 +1102,8 @@ static int __io_register_rsrc_update(struct io_ring_ctx *ctx, unsigned type,
|
|||||||
unsigned nr_args);
|
unsigned nr_args);
|
||||||
static void io_clean_op(struct io_kiocb *req);
|
static void io_clean_op(struct io_kiocb *req);
|
||||||
static struct file *io_file_get(struct io_ring_ctx *ctx,
|
static struct file *io_file_get(struct io_ring_ctx *ctx,
|
||||||
struct io_kiocb *req, int fd, bool fixed);
|
struct io_kiocb *req, int fd, bool fixed,
|
||||||
|
unsigned int issue_flags);
|
||||||
static void __io_queue_sqe(struct io_kiocb *req);
|
static void __io_queue_sqe(struct io_kiocb *req);
|
||||||
static void io_rsrc_put_work(struct work_struct *work);
|
static void io_rsrc_put_work(struct work_struct *work);
|
||||||
|
|
||||||
@@ -3985,7 +3986,7 @@ static int io_tee(struct io_kiocb *req, unsigned int issue_flags)
|
|||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
|
||||||
in = io_file_get(req->ctx, req, sp->splice_fd_in,
|
in = io_file_get(req->ctx, req, sp->splice_fd_in,
|
||||||
(sp->flags & SPLICE_F_FD_IN_FIXED));
|
(sp->flags & SPLICE_F_FD_IN_FIXED), issue_flags);
|
||||||
if (!in) {
|
if (!in) {
|
||||||
ret = -EBADF;
|
ret = -EBADF;
|
||||||
goto done;
|
goto done;
|
||||||
@@ -4025,7 +4026,7 @@ static int io_splice(struct io_kiocb *req, unsigned int issue_flags)
|
|||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
|
||||||
in = io_file_get(req->ctx, req, sp->splice_fd_in,
|
in = io_file_get(req->ctx, req, sp->splice_fd_in,
|
||||||
(sp->flags & SPLICE_F_FD_IN_FIXED));
|
(sp->flags & SPLICE_F_FD_IN_FIXED), issue_flags);
|
||||||
if (!in) {
|
if (!in) {
|
||||||
ret = -EBADF;
|
ret = -EBADF;
|
||||||
goto done;
|
goto done;
|
||||||
@@ -6886,13 +6887,16 @@ static void io_fixed_file_set(struct io_fixed_file *file_slot, struct file *file
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline struct file *io_file_get_fixed(struct io_ring_ctx *ctx,
|
static inline struct file *io_file_get_fixed(struct io_ring_ctx *ctx,
|
||||||
struct io_kiocb *req, int fd)
|
struct io_kiocb *req, int fd,
|
||||||
|
unsigned int issue_flags)
|
||||||
{
|
{
|
||||||
struct file *file;
|
struct file *file = NULL;
|
||||||
unsigned long file_ptr;
|
unsigned long file_ptr;
|
||||||
|
|
||||||
|
io_ring_submit_lock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
|
||||||
|
|
||||||
if (unlikely((unsigned int)fd >= ctx->nr_user_files))
|
if (unlikely((unsigned int)fd >= ctx->nr_user_files))
|
||||||
return NULL;
|
goto out;
|
||||||
fd = array_index_nospec(fd, ctx->nr_user_files);
|
fd = array_index_nospec(fd, ctx->nr_user_files);
|
||||||
file_ptr = io_fixed_file_slot(&ctx->file_table, fd)->file_ptr;
|
file_ptr = io_fixed_file_slot(&ctx->file_table, fd)->file_ptr;
|
||||||
file = (struct file *) (file_ptr & FFS_MASK);
|
file = (struct file *) (file_ptr & FFS_MASK);
|
||||||
@@ -6900,6 +6904,8 @@ static inline struct file *io_file_get_fixed(struct io_ring_ctx *ctx,
|
|||||||
/* mask in overlapping REQ_F and FFS bits */
|
/* mask in overlapping REQ_F and FFS bits */
|
||||||
req->flags |= (file_ptr << REQ_F_NOWAIT_READ_BIT);
|
req->flags |= (file_ptr << REQ_F_NOWAIT_READ_BIT);
|
||||||
io_req_set_rsrc_node(req);
|
io_req_set_rsrc_node(req);
|
||||||
|
out:
|
||||||
|
io_ring_submit_unlock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6917,10 +6923,11 @@ static struct file *io_file_get_normal(struct io_ring_ctx *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline struct file *io_file_get(struct io_ring_ctx *ctx,
|
static inline struct file *io_file_get(struct io_ring_ctx *ctx,
|
||||||
struct io_kiocb *req, int fd, bool fixed)
|
struct io_kiocb *req, int fd, bool fixed,
|
||||||
|
unsigned int issue_flags)
|
||||||
{
|
{
|
||||||
if (fixed)
|
if (fixed)
|
||||||
return io_file_get_fixed(ctx, req, fd);
|
return io_file_get_fixed(ctx, req, fd, issue_flags);
|
||||||
else
|
else
|
||||||
return io_file_get_normal(ctx, req, fd);
|
return io_file_get_normal(ctx, req, fd);
|
||||||
}
|
}
|
||||||
@@ -7142,7 +7149,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
|
|||||||
|
|
||||||
if (io_op_defs[req->opcode].needs_file) {
|
if (io_op_defs[req->opcode].needs_file) {
|
||||||
req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
|
req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
|
||||||
(sqe_flags & IOSQE_FIXED_FILE));
|
(sqe_flags & IOSQE_FIXED_FILE), 0);
|
||||||
if (unlikely(!req->file))
|
if (unlikely(!req->file))
|
||||||
ret = -EBADF;
|
ret = -EBADF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1020,6 +1020,7 @@ static void caif_sock_destructor(struct sock *sk)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sk_stream_kill_queues(&cf_sk->sk);
|
sk_stream_kill_queues(&cf_sk->sk);
|
||||||
|
WARN_ON(sk->sk_forward_alloc);
|
||||||
caif_free_client(&cf_sk->layer);
|
caif_free_client(&cf_sk->layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5383,7 +5383,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
|
|||||||
neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
|
neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!neigh)
|
if (!neigh || !(neigh->nud_state & NUD_VALID))
|
||||||
return BPF_FIB_LKUP_RET_NO_NEIGH;
|
return BPF_FIB_LKUP_RET_NO_NEIGH;
|
||||||
|
|
||||||
return bpf_fib_set_fwd_params(params, neigh, dev);
|
return bpf_fib_set_fwd_params(params, neigh, dev);
|
||||||
@@ -5496,7 +5496,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
|
|||||||
* not needed here.
|
* not needed here.
|
||||||
*/
|
*/
|
||||||
neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
|
neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
|
||||||
if (!neigh)
|
if (!neigh || !(neigh->nud_state & NUD_VALID))
|
||||||
return BPF_FIB_LKUP_RET_NO_NEIGH;
|
return BPF_FIB_LKUP_RET_NO_NEIGH;
|
||||||
|
|
||||||
return bpf_fib_set_fwd_params(params, neigh, dev);
|
return bpf_fib_set_fwd_params(params, neigh, dev);
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
|
|||||||
(n->nud_state == NUD_NOARP) ||
|
(n->nud_state == NUD_NOARP) ||
|
||||||
(tbl->is_multicast &&
|
(tbl->is_multicast &&
|
||||||
tbl->is_multicast(n->primary_key)) ||
|
tbl->is_multicast(n->primary_key)) ||
|
||||||
time_after(tref, n->updated))
|
!time_in_range(n->updated, tref, jiffies))
|
||||||
remove = true;
|
remove = true;
|
||||||
write_unlock(&n->lock);
|
write_unlock(&n->lock);
|
||||||
|
|
||||||
@@ -262,7 +262,17 @@ static int neigh_forced_gc(struct neigh_table *tbl)
|
|||||||
|
|
||||||
static void neigh_add_timer(struct neighbour *n, unsigned long when)
|
static void neigh_add_timer(struct neighbour *n, unsigned long when)
|
||||||
{
|
{
|
||||||
|
/* Use safe distance from the jiffies - LONG_MAX point while timer
|
||||||
|
* is running in DELAY/PROBE state but still show to user space
|
||||||
|
* large times in the past.
|
||||||
|
*/
|
||||||
|
unsigned long mint = jiffies - (LONG_MAX - 86400 * HZ);
|
||||||
|
|
||||||
neigh_hold(n);
|
neigh_hold(n);
|
||||||
|
if (!time_in_range(n->confirmed, mint, jiffies))
|
||||||
|
n->confirmed = mint;
|
||||||
|
if (time_before(n->used, n->confirmed))
|
||||||
|
n->used = n->confirmed;
|
||||||
if (unlikely(mod_timer(&n->timer, when))) {
|
if (unlikely(mod_timer(&n->timer, when))) {
|
||||||
printk("NEIGH: BUG, double timer add, state is %x\n",
|
printk("NEIGH: BUG, double timer add, state is %x\n",
|
||||||
n->nud_state);
|
n->nud_state);
|
||||||
@@ -948,12 +958,14 @@ static void neigh_periodic_work(struct work_struct *work)
|
|||||||
goto next_elt;
|
goto next_elt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time_before(n->used, n->confirmed))
|
if (time_before(n->used, n->confirmed) &&
|
||||||
|
time_is_before_eq_jiffies(n->confirmed))
|
||||||
n->used = n->confirmed;
|
n->used = n->confirmed;
|
||||||
|
|
||||||
if (refcount_read(&n->refcnt) == 1 &&
|
if (refcount_read(&n->refcnt) == 1 &&
|
||||||
(state == NUD_FAILED ||
|
(state == NUD_FAILED ||
|
||||||
time_after(jiffies, n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
|
!time_in_range_open(jiffies, n->used,
|
||||||
|
n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
|
||||||
*np = n->next;
|
*np = n->next;
|
||||||
neigh_mark_dead(n);
|
neigh_mark_dead(n);
|
||||||
write_unlock(&n->lock);
|
write_unlock(&n->lock);
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ void sk_stream_kill_queues(struct sock *sk)
|
|||||||
sk_mem_reclaim(sk);
|
sk_mem_reclaim(sk);
|
||||||
|
|
||||||
WARN_ON(sk->sk_wmem_queued);
|
WARN_ON(sk->sk_wmem_queued);
|
||||||
WARN_ON(sk->sk_forward_alloc);
|
|
||||||
|
|
||||||
/* It is _impossible_ for the backlog to contain anything
|
/* It is _impossible_ for the backlog to contain anything
|
||||||
* when we get here. All user references to this socket
|
* when we get here. All user references to this socket
|
||||||
|
|||||||
@@ -207,6 +207,52 @@ static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
|
|||||||
skb->mark = 0;
|
skb->mark = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int xfrmi_input(struct sk_buff *skb, int nexthdr, __be32 spi,
|
||||||
|
int encap_type, unsigned short family)
|
||||||
|
{
|
||||||
|
struct sec_path *sp;
|
||||||
|
|
||||||
|
sp = skb_sec_path(skb);
|
||||||
|
if (sp && (sp->len || sp->olen) &&
|
||||||
|
!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family))
|
||||||
|
goto discard;
|
||||||
|
|
||||||
|
XFRM_SPI_SKB_CB(skb)->family = family;
|
||||||
|
if (family == AF_INET) {
|
||||||
|
XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
|
||||||
|
XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = NULL;
|
||||||
|
} else {
|
||||||
|
XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr);
|
||||||
|
XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return xfrm_input(skb, nexthdr, spi, encap_type);
|
||||||
|
discard:
|
||||||
|
kfree_skb(skb);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int xfrmi4_rcv(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return xfrmi_input(skb, ip_hdr(skb)->protocol, 0, 0, AF_INET);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int xfrmi6_rcv(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return xfrmi_input(skb, skb_network_header(skb)[IP6CB(skb)->nhoff],
|
||||||
|
0, 0, AF_INET6);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int xfrmi4_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
|
||||||
|
{
|
||||||
|
return xfrmi_input(skb, nexthdr, spi, encap_type, AF_INET);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int xfrmi6_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
|
||||||
|
{
|
||||||
|
return xfrmi_input(skb, nexthdr, spi, encap_type, AF_INET6);
|
||||||
|
}
|
||||||
|
|
||||||
static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
|
static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
|
||||||
{
|
{
|
||||||
const struct xfrm_mode *inner_mode;
|
const struct xfrm_mode *inner_mode;
|
||||||
@@ -780,8 +826,8 @@ static struct pernet_operations xfrmi_net_ops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct xfrm6_protocol xfrmi_esp6_protocol __read_mostly = {
|
static struct xfrm6_protocol xfrmi_esp6_protocol __read_mostly = {
|
||||||
.handler = xfrm6_rcv,
|
.handler = xfrmi6_rcv,
|
||||||
.input_handler = xfrm_input,
|
.input_handler = xfrmi6_input,
|
||||||
.cb_handler = xfrmi_rcv_cb,
|
.cb_handler = xfrmi_rcv_cb,
|
||||||
.err_handler = xfrmi6_err,
|
.err_handler = xfrmi6_err,
|
||||||
.priority = 10,
|
.priority = 10,
|
||||||
@@ -831,8 +877,8 @@ static struct xfrm6_tunnel xfrmi_ip6ip_handler __read_mostly = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct xfrm4_protocol xfrmi_esp4_protocol __read_mostly = {
|
static struct xfrm4_protocol xfrmi_esp4_protocol __read_mostly = {
|
||||||
.handler = xfrm4_rcv,
|
.handler = xfrmi4_rcv,
|
||||||
.input_handler = xfrm_input,
|
.input_handler = xfrmi4_input,
|
||||||
.cb_handler = xfrmi_rcv_cb,
|
.cb_handler = xfrmi_rcv_cb,
|
||||||
.err_handler = xfrmi4_err,
|
.err_handler = xfrmi4_err,
|
||||||
.priority = 10,
|
.priority = 10,
|
||||||
|
|||||||
@@ -3698,6 +3698,9 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
|
|||||||
goto reject;
|
goto reject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (if_id)
|
||||||
|
secpath_reset(skb);
|
||||||
|
|
||||||
xfrm_pols_put(pols, npols);
|
xfrm_pols_put(pols, npols);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,10 +95,13 @@ all_sources()
|
|||||||
|
|
||||||
all_compiled_sources()
|
all_compiled_sources()
|
||||||
{
|
{
|
||||||
realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) \
|
{
|
||||||
include/generated/autoconf.h $(find $ignore -name "*.cmd" -exec \
|
echo include/generated/autoconf.h
|
||||||
grep -Poh '(?(?=^source_.* \K).*|(?=^ \K\S).*(?= \\))' {} \+ |
|
find $ignore -name "*.cmd" -exec \
|
||||||
awk '!a[$0]++') | sort -u
|
sed -n -E 's/^source_.* (.*)/\1/p; s/^ (\S.*) \\/\1/p' {} \+ |
|
||||||
|
awk '!a[$0]++'
|
||||||
|
} | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
|
||||||
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
all_target_sources()
|
all_target_sources()
|
||||||
|
|||||||
Reference in New Issue
Block a user