Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
not being needed), then the filesystem shouldn't change its mind and try to verify the pages when the bio completes if verity happened to be enabled concurrently. It's too late for that bio. - Eric

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 01:48:24PM +0900, Daeho Jeong wrote: > Eric, > > I have another question. > I understand enabling the verity can be possible in the middle of I/O. > Is the opposite way also possible? Actually, I couldn't find any > disabling function of it, thoug

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
t needs to be checked only once, at the beginning... - Eric

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
>cluster_size = cc->cluster_size; > dic->log_cluster_size = cc->log_cluster_size; The check for fsverity_active() is wrong. It looks like you need to know whether the bio needs to go through the fs-verity data verification. The correct way to determine that is to check whether STEP_VERITY is enabled in the bio's bio_post_read_ctx. It's set by f2fs_grab_read_bio() when needed. - Eric

[PATCH 3/3] exec: Transform exec_update_mutex into a rw_semaphore

2020-12-03 Thread Eric W. Biederman
guard_mutex") [0] https://lkml.kernel.org/r/63640c05ade8e...@google.com Reported-by: syzbot+db9cdf3dd1f64252c...@syzkaller.appspotmail.com Signed-off-by: Eric W. Biederman --- fs/exec.c| 12 ++-- fs/proc/base.c | 10 +- include/linux/sched/sig

[PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-03 Thread Eric W. Biederman
Zijlstra Cc: Ingo Molnar Cc: Will Deacon Signed-off-by: Eric W. Biederman --- include/linux/rwsem.h | 1 + kernel/locking/rwsem.c | 26 ++ 2 files changed, 27 insertions(+) diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 13021b08b2ed..4c715be48717 100644

[PATCH 1/3] rwsem: Implement down_read_killable_nested

2020-12-03 Thread Eric W. Biederman
Molnar Cc: Will Deacon Signed-off-by: Eric W. Biederman --- include/linux/rwsem.h | 2 ++ kernel/locking/rwsem.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 25e3fde85617..13021b08b2ed 100644 --- a/include/linux/rwsem.h

[PATCH 0/3] exec: Transform exec_update_mutex into a rw_semaphore

2020-12-03 Thread Eric W. Biederman
has the functionality needed and uses a rw_semaphore to replace the current mutex. Eric W. Biederman (3): rwsem: Implement down_read_killable_nested rwsem: Implement down_read_interruptible exec: Transform exec_update_mutex into a rw_semaphore fs/exec.c| 12

Re: [f2fs-dev] [PATCH v6] f2fs: compress: support compress level

2020-12-03 Thread Eric Biggers
el is *not* a stable interface. It can change when the compressor is updated, as long as the output continues to be compatible with the decompressor. So does compression level really belong in the on-disk format? - Eric

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Eric Dumazet
On 12/3/20 6:41 PM, Marco Elver wrote: > One more experiment -- simply adding > > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -207,7 +207,21 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t > gfp_mask, >*/ > size = SKB_DATA_ALIGN(size); > size += SKB_DATA

Re: [PATCH] common/rc: Fix _check_s_dax()

2020-12-03 Thread Eric Sandeen
my suggestion. I think we should always error out when > the bit value shared with STATX_ATTR_MOUNT_ROOT is seen. Because that > means the kernel is not using or fixed ABI we agreed to use going > forward. *nod* and my suggestion was to explicitly test for the old/wrong value and offer the test-runner a hint about why it may have been set (missing the fix commit), but we should still ultimately fail the test when it is seen. -Eric

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Eric Dumazet
On Thu, Dec 3, 2020 at 5:34 PM Marco Elver wrote: > > On Thu, 3 Dec 2020 at 17:27, Eric Dumazet wrote: > > On Thu, Dec 3, 2020 at 4:58 PM Marco Elver wrote: > > > > > > On Mon, Nov 30, 2020 at 12:40AM -0800, syzbot wrote: > > > > Hello, > >

Re: WARNING in sk_stream_kill_queues (5)

2020-12-03 Thread Eric Dumazet
On Thu, Dec 3, 2020 at 4:58 PM Marco Elver wrote: > > On Mon, Nov 30, 2020 at 12:40AM -0800, syzbot wrote: > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit:6147c83f Add linux-next specific files for 20201126 > > git tree: linux-next > > console output: https://

Re: [PATCH v1 bpf-next 03/11] tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.

2020-12-03 Thread Eric Dumazet
On Thu, Dec 3, 2020 at 3:14 PM Kuniyuki Iwashima wrote: > > From: Eric Dumazet > Date: Tue, 1 Dec 2020 16:25:51 +0100 > > On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote: > > > This patch lets reuseport_detach_sock() return a pointer of struct sock, > > > which

Re: [PATCH v13 05/15] iommu/smmuv3: Get prepared for nested stage support

2020-12-03 Thread Auger Eric
Hi Kunkun, On 12/3/20 1:32 PM, Kunkun Jiang wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> When nested stage translation is setup, both s1_cfg and >> s2_cfg are set. >> >> We introduce a new smmu domain abort field that will be set >>

Re: [PATCH v1 2/5] vfio: platform: Switch to use platform_get_mem_or_io_resource()

2020-12-03 Thread Auger Eric
Hi Andy, On 10/27/20 6:58 PM, Andy Shevchenko wrote: > Switch to use new platform_get_mem_or_io_resource() instead of > home grown analogue. > > Cc: Eric Auger > Cc: Alex Williamson > Cc: Cornelia Huck > Cc: k...@vger.kernel.org > Signed-off-by: Andy Shevchenko Acked

Re: [PATCH v2 0/2] Let illegal access to user-space memory die

2020-12-03 Thread Eric Lin
On Thu, Dec 03, 2020 at 03:29:57PM +0800, Pekka Enberg wrote: Hi Pekka, > Hi Eric, > > On Thu, Dec 3, 2020 at 8:51 AM Eric Lin wrote: > > > > Accesses to user-space memory without calling uaccess routine > > leads to hanging in page fault handler. Like arm64, we let

[PATCH v2 2/2] riscv/mm: Prevent kernel module to access user memory without uaccess routines

2020-12-02 Thread Eric Lin
We found this issue in an legacy out-of-tree kernel module which didn't properly access user space pointer by get/put_user(). Such an illegal access loops in the page fault handler. To resolve this, let it die here. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 5 +++

[PATCH v2 1/2] riscv/mm: Introduce a die_kernel_fault() helper function

2020-12-02 Thread Eric Lin
Like arm64, this patch adds a die_kernel_fault() helper to ensure the same semantics for the different kernel faults. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c

[PATCH v2 0/2] Let illegal access to user-space memory die

2020-12-02 Thread Eric Lin
Accesses to user-space memory without calling uaccess routine leads to hanging in page fault handler. Like arm64, we let it die earlier in page fault handler. Changes in v2: -Add a die_kernel_fault() helper -Split one long line code into two Eric Lin (2): riscv/mm: Introduce a

Re: [PATCH] pid: add null pointer check in pid_nr_ns()

2020-12-02 Thread Eric W. Biederman
pace can be passed as NULL. So I really suspect you have a larger but somewhere in the caller of pid_nr_ns. Perhaps the memory was stomped and you were lucky it was NULL. Without some more details I really don't think testing for a NULL namespace is useful or productive. At best it will mask

Re: [RFC PATCH] common/rc: Fix _check_s_dax() for kernel 5.10

2020-12-02 Thread Eric Sandeen
(( attributes & 0x2000 )) || echo "$target doesn't have > expected S_DAX flag" > + (( attributes & 0x0020 )) || echo "$target doesn't have > expected S_DAX flag" I suppose you could add a test for 0x2000 in this failure case, and echo "Is your kernel missing commit xx?" as another hint. -Eric > fi > } > >

Re: [PATCH] exec: Move io_uring_task_cancel after the point of no return

2020-12-02 Thread Eric W. Biederman
ebied...@xmission.com (Eric W. Biederman) writes: > Now that unshare_files happens in begin_new_exec after the point of no > return, io_uring_task_cancel can also happen later. > > Effectively this means io_uring activities for a task are only canceled > when exec succeeds. &g

Re: [RFC][PATCH] coredump: Document coredump code exclusively used by cell spufs

2020-12-02 Thread Eric W. Biederman
ebied...@xmission.com (Eric W. Biederman) writes: > Oleg Nesterov recently asked[1] why is there an unshare_files in > do_coredump. After digging through all of the callers of lookup_fd it > turns out that it is > arch/powerpc/platforms/cell/spufs/coredump.c:coredump_next_context

Re: [PATCH v2 3/5] vfio: platform: simplify device removal

2020-12-02 Thread Auger Eric
igned-off-by: Uwe Kleine-König Acked-by: Eric Auger Thanks Eric > --- > drivers/vfio/platform/vfio_amba.c | 14 +- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/drivers/vfio/platform/vfio_amba.c > b/drivers/vfio/platform/vfio_amba.c > in

Re: [RFC v2 1/1] vfio/platform: add support for msi

2020-12-02 Thread Auger Eric
igate; > struct module *parent_module; > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index 2f313a238a8f..598d1c944283 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -697,11 +697,54 @@ struct vfio_irq_info { > #define VFIO_IRQ_INFO_MASKABLE (1 << 1) > #define VFIO_IRQ_INFO_AUTOMASKED (1 << 2) > #define VFIO_IRQ_INFO_NORESIZE (1 << 3) > +#define VFIO_IRQ_INFO_FLAG_CAPS (1 << 4) /* Info supports caps > */ > __u32 index; /* IRQ index */ > __u32 count; /* Number of IRQs within this index */ > + __u32 cap_offset; /* Offset within info struct of first cap */ > }; > #define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9) > > +/* > + * The irq type capability allows IRQs unique to a specific device or > + * class of devices to be exposed. > + * > + * The structures below define version 1 of this capability. > + */ > +#define VFIO_IRQ_INFO_CAP_TYPE 3 > + > +struct vfio_irq_info_cap_type { > + struct vfio_info_cap_header header; > + __u32 type; /* global per bus driver */ > + __u32 subtype; /* type specific */ > +}; > + > +/* > + * List of IRQ types, global per bus driver. > + * If you introduce a new type, please add it here. > + */ > + > +/* Non PCI devices having MSI(s) support */ > +#define VFIO_IRQ_TYPE_MSI(1) > + > +/* > + * The msi capability allows the user to use the msi msg to > + * configure the iova for the msi configuration. > + * The structures below define version 1 of this capability. > + */ > +#define VFIO_IRQ_INFO_CAP_MSI_DESCS 4 > + > +struct vfio_irq_msi_msg { > + __u32 addr_lo; > + __u32 addr_hi; > + __u32 data; > +}; > + > +struct vfio_irq_info_cap_msi { > + struct vfio_info_cap_header header; > + __u32 nr_msgs; I think you should align a __u32 reserved field to have a 64b alignment > + struct vfio_irq_msi_msg msgs[]; Please can you clarify why this cap is needed versus your prior approach. > +}; > + > /** > * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct > vfio_irq_set) > * > Thanks Eric

Re: [RFC, v2 0/1] msi support for platform devices

2020-12-02 Thread Auger Eric
> 2) Removed vendor specific module for msi handling so > previously patch2 and patch3 are not required. > > 3) MSI related data is exported to userspace using 'caps'. >Please note VFIO_IRQ_INFO_CAP_TYPE in include/uapi/linux/vfio.h > im

Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
filesystem, set the actual attribute flag adjacent to it, as is done for ~every other flag. *shrug* In any case I resent the flag value clash fix on a separate thread as V2, hopefully that one is straightforward enough to go in. Thanks, -Eric

[PATCH V2] uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT

2020-12-01 Thread Eric Sandeen
or some of the attributes, and explain why the value for DAX does not match. Fixes: 80340fe3605c ("statx: add mount_root") Fixes: 712b2698e4c0 ("fs/stat: Define DAX statx attribute") Reported-by: David Howells Signed-off-by: Eric Sandeen Reviewed-by: David Howells --- V2: Chan

Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
On 12/1/20 4:12 PM, Linus Torvalds wrote: > On Tue, Dec 1, 2020 at 2:03 PM Eric Sandeen wrote: >> >> That's why I was keen to just add DAX unconditionally at this point, and if >> we want >> to invent/refine meanings for the mask, we can still try to do that? >

Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
On 12/1/20 2:52 PM, Dave Chinner wrote: > On Tue, Dec 01, 2020 at 09:39:05AM -0800, Darrick J. Wong wrote: >> On Tue, Dec 01, 2020 at 10:59:36AM -0600, Eric Sandeen wrote: >>> It's a bit odd to set STATX_ATTR_DAX into the statx attributes in the VFS; >>> while th

Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
On 12/1/20 2:04 PM, Linus Torvalds wrote: > On Tue, Dec 1, 2020 at 8:59 AM Eric Sandeen wrote: >> >> It's a bit odd to set STATX_ATTR_DAX into the statx attributes in the VFS; >> while the VFS can detect the current DAX state, it is the filesystem which >> actua

Re: [PATCH 1/2] uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT

2020-12-01 Thread Eric Sandeen
On 12/1/20 12:31 PM, Andreas Dilger wrote: > On Dec 1, 2020, at 10:44 AM, Eric Sandeen wrote: >> >> On 12/1/20 11:32 AM, Darrick J. Wong wrote: >>> On Tue, Dec 01, 2020 at 10:57:11AM -0600, Eric Sandeen wrote: >>>> STATX_ATTR_MOUNT_ROOT and STATX_ATTR_DAX got

Re: [PATCH v3] drivers/virt: vmgenid: add vm generation id driver

2020-12-01 Thread Eric W. Biederman
> If there is no acpi vmgenid device present, the generation changes are > not driven by hw vmgenid events but can be driven by software through > a dedicated driver ioctl. > > This patch builds on top of Or Idgar 's proposal > https://lkml.org/lkml/2018/3/1/498 Eric

Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
ument, but the exact details of what the mask means in general, and for dax in particular, seems to be subject to ongoing debate. I'd like to just set it with the simplest definition "the fileystem supports the feature" for now, so that we aren't ever setting a feature that's omitted from the mask, and refine the mask-setting for the dax flag in another iteration if/when we reach agreement. -Eric > --D >

Re: [PATCH] kernel: automatically split user namespace extent

2020-12-01 Thread Eric W. Biederman
ap, &extent); > - if (ret < 0) > - goto out; > - ret = -EINVAL; > + split_overlapping_mappings(parent_map, &extent, > &overflow_extent); > + > + ret = insert_extent(&new_map, &extent); > + if (ret < 0) > + goto out; > + ret = -EINVAL; > + > + extent = overflow_extent; > + } while (overflow_extent.first != (u32) -1); > } > /* Be very certaint the new map actually exists */ > if (new_map.nr_extents == 0) Eric

Re: [PATCH 1/2] uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT

2020-12-01 Thread Eric Sandeen
On 12/1/20 11:32 AM, Darrick J. Wong wrote: > On Tue, Dec 01, 2020 at 10:57:11AM -0600, Eric Sandeen wrote: >> STATX_ATTR_MOUNT_ROOT and STATX_ATTR_DAX got merged with the same value, >> so one of them needs fixing. Move STATX_ATTR_DAX. >> >> While we're in here, c

[PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems

2020-12-01 Thread Eric Sandeen
ts" [1] so that the statx attributes_mask can be properly set. So, move STATX_ATTR_DAX attribute setting to the individual dax-capable filesystems, and update the attributes_mask there as well. [1] 3209f68b3ca4 statx: Include a mask for stx_attributes in struct statx Signed-off-by: Eric S

[PATCH 1/2] uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT

2020-12-01 Thread Eric Sandeen
STATX_ATTR_MOUNT_ROOT and STATX_ATTR_DAX got merged with the same value, so one of them needs fixing. Move STATX_ATTR_DAX. While we're in here, clarify the value-matching scheme for some of the attributes, and explain why the value for DAX does not match. Signed-off-by: Eric Sa

[PATCH 0/2] statx: Fix DAX attribute collision and handling

2020-12-01 Thread Eric Sandeen
from the vfs into the dax-capable filesystems so that they can set the statx atrributes_mask appropriately. Thanks, -Eric

Re: [PATCH v1 bpf-next 04/11] tcp: Migrate TFO requests causing RST during TCP_SYN_RECV.

2020-12-01 Thread Eric Dumazet
On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote: > A TFO request socket is only freed after BOTH 3WHS has completed (or > aborted) and the child socket has been accepted (or its listener has been > closed). Hence, depending on the order, there can be two kinds of request > sockets in the accept queu

Re: [PATCH v1 bpf-next 03/11] tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.

2020-12-01 Thread Eric Dumazet
On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote: > This patch lets reuseport_detach_sock() return a pointer of struct sock, > which is used only by inet_unhash(). If it is not NULL, > inet_csk_reqsk_queue_migrate() migrates TCP_ESTABLISHED/TCP_SYN_RECV > sockets from the closing listener to the sele

Re: [PATCH v1 bpf-next 05/11] tcp: Migrate TCP_NEW_SYN_RECV requests.

2020-12-01 Thread Eric Dumazet
On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote: > This patch renames reuseport_select_sock() to __reuseport_select_sock() and > adds two wrapper function of it to pass the migration type defined in the > previous commit. > > reuseport_select_sock : BPF_SK_REUSEPORT_MIGRATE_NO > reusep

Re: [PATCH] proc: add locking checks in proc_inode_is_dead

2020-12-01 Thread Eric W. Biederman
Oleg Nesterov writes: > On 11/30, Eric W. Biederman wrote: >> >> Ouch Oleg I just looked the introduction of proc_inode_is_dead in >> d855a4b79f49 ("proc: don't (ab)use ->group_leader in proc_task_readdir() >> paths") introduced a ``regress

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2020-12-01 Thread Auger Eric
Hi Xingang, On 12/1/20 2:33 PM, Xingang Wang wrote: > Hi Eric > > On Wed, 18 Nov 2020 12:21:43, Eric Auger wrote: >> @@ -1710,7 +1710,11 @@ static void arm_smmu_tlb_inv_context(void *cookie) >> * insertion to guarantee those are observed before the TLBI. Do be &g

Re: [PATCH] pid: add null pointer check in pid_nr_ns()

2020-11-30 Thread Eric W. Biederman
the backtrace you provided. Maybe it is sane to check for NULL but it may be preferable to fix the caller. Eric > Signed-off-by: Alakesh Haloi > Cc: sta...@vger.kernel.org > --- > kernel/pid.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/pid.c

Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Eric Lin
On Mon, Nov 30, 2020 at 04:07:03PM +0800, Pekka Enberg wrote: Hi Pekka, > On Mon, Nov 30, 2020 at 7:33 AM Eric Lin wrote: > > > > In the page fault handler, an access to user-space memory > > without get/put_user() or copy_from/to_user() routines is > > not resolved p

Re: [PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-30 Thread Eric Lin
On Mon, Nov 30, 2020 at 04:30:15PM +0800, Christoph Hellwig wrote: Hi Christoph, > > + if (!user_mode(regs) && addr < TASK_SIZE && unlikely(!(regs->status & > > SR_SUM))) > > Please avoid the overly long line. OK, I'll modify it in v2. Thanks for your review.

[PATCH] exec: Move io_uring_task_cancel after the point of no return

2020-11-30 Thread Eric W. Biederman
Now that unshare_files happens in begin_new_exec after the point of no return, io_uring_task_cancel can also happen later. Effectively this means io_uring activities for a task are only canceled when exec succeeds. Signed-off-by: Eric W. Biederman --- This is against my exec-for-v5.11 branch

Re: [PATCH v2 02/24] exec: Simplify unshare_files

2020-11-30 Thread Eric W. Biederman
Arnd Bergmann writes: > On Wed, Nov 25, 2020 at 2:16 AM Eric W. Biederman > wrote: >> > On 11/24/20 12:14 PM, Arnd Bergmann wrote: >> > >> > There are still PS3-Linux users out there. They use 'Homebrew' firmware >> > released through 

Re: [PATCH] proc: Allow pid_revalidate() during LOOKUP_RCU

2020-11-30 Thread Eric W. Biederman
Stephen Brennan writes: > The pid_revalidate() function requires dropping from RCU into REF lookup > mode. When many threads are resolving paths within /proc in parallel, > this can result in heavy spinlock contention as each thread tries to > grab a reference to the /proc dentry (and drop it sho

Re: [PATCH] signal/parics: Remove parsic specific definition of __ARCH_UAPI_SA_FLAGS

2020-11-30 Thread Eric W. Biederman
Randy Dunlap writes: > On 11/30/20 9:30 AM, Eric W. Biederman wrote: >> >> Randy Dunlap wrote: >>> On 11/27/20 10:43 AM, Randy Dunlap wrote: >>> >>>> on parisc, _SA_SIGGFAULT is undefined and causing build errors. >>>> >>>&g

Re: memory leak in prepare_creds

2020-11-30 Thread Eric W. Biederman
b22349e>] alloc_file+0x33/0x1b0 fs/file_table.c:193 > [<6e1465bb>] alloc_file_pseudo+0xb2/0x140 fs/file_table.c:233 > [<7118092a>] anon_inode_getfile fs/anon_inodes.c:91 [inline] > [<7118092a>] anon_inode_getfile+0xaa/0x120 fs/anon_inodes.c:74 > [<2ae99012>] io_uring_get_fd fs/io_uring.c:9198 [inline] > [<2ae99012>] io_uring_create fs/io_uring.c:9377 [inline] > [<2ae99012>] io_uring_setup+0x1125/0x1630 fs/io_uring.c:9411 > [<8280baad>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 > [<685d8cf0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Eric

Re: [PATCH] proc: add locking checks in proc_inode_is_dead

2020-11-30 Thread Eric W. Biederman
oc_inode_is_dead is definitely not the place to look to close races. Eric > Signed-off-by: Wen Yang > Cc: Oleg Nesterov > Cc: "Eric W. Biederman" > Cc: Alexey Dobriyan > Cc: Christian Brauner > Cc: linux-kernel@vger.kernel.org > Cc: linux-fsde...@vger.ke

Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks

2020-11-30 Thread Eric Biggers
On Fri, Nov 27, 2020 at 09:01:47AM +0800, Chao Yu wrote: > On 2020/11/27 1:55, Eric Biggers wrote: > > On Thu, Nov 26, 2020 at 06:37:09PM +0800, Chao Yu wrote: > > > Support to use address space of inner inode to cache compressed block, > > > in order to improve cac

[PATCH] signal/parics: Remove parsic specific definition of __ARCH_UAPI_SA_FLAGS

2020-11-30 Thread Eric W. Biederman
_SA_FLAGS that was just added. Reported-by: Randy Dunlap Fixes: 23acdc76f179 ("signal: clear non-uapi flag bits when passing/returning sa_flags") Signed-off-by: "Eric W. Biederman" --- arch/parisc/include/asm/signal.h | 2 -- 1 file changed, 2 deletions(-) I am applying this t

Re: linux-next: Tree for Nov 27 (parisc: signal flags)

2020-11-30 Thread Eric W. Biederman
>> >> >> _SA_SIGGFAULT is not used or defined anywhere else in the >> kernel source tree. > > > _SA_SIGGFAULT was removed by commit > > 41f5a81c07cd ("parisc: Drop HP-UX specific fcntl and signal flags") > > which was added to Linus' tree in v5.10-rc1. Thanks. It looks like one of the patches in the patchset took so long it got out of date. I will sort it out. Eric

[PATCH] riscv/mm: Prevent kernel module access user-space memory without uaccess routines

2020-11-29 Thread Eric Lin
In the page fault handler, an access to user-space memory without get/put_user() or copy_from/to_user() routines is not resolved properly. Like arm and other architectures, we need to let it die earlier in page fault handler. Signed-off-by: Eric Lin Cc: Alan Kao --- arch/riscv/mm/fault.c | 3

Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks

2020-11-26 Thread Eric Biggers
cached still encrypted, or are they decrypted? - Eric

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-26 Thread Eric Biggers
On Thu, Nov 26, 2020 at 02:04:41PM +0900, Daeho Jeong wrote: > Eric, > > do_page_cache_ra() is defined in mm/internal.h for internal use > between in mm, so we cannot use this one right now. > So, I think we could use page_cache_ra_unbounded(), because we already > check i_si

Re: linux-next: manual merge of the userns tree with the bpf-next tree

2020-11-26 Thread Eric W. Biederman
gt; non trivial conflicts should be mentioned to your upstream maintainer > when your tree is submitted for merging. You may also want to consider > cooperating with the maintainer of the conflicting tree to minimise any > particularly complex conflicts. Thanks. Reading through the diff that looks right, and it has been already reported. Eric

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-25 Thread Eric Biggers
block/blk-mq.c > @@ -2161,6 +2161,9 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio) > blk_queue_bounce(q, &bio); > __blk_queue_split(&bio, &nr_segs); > > + if (bio->bi_status != BLK_STS_OK) > + goto queue_exit; > + Note that as soon as bio_endio() is called, the bio may be freed. So accessing the bio after that is not correct. - Eric

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-25 Thread Eric Biggers
s) is done by assuming that > bv->bv_len is always lbs aligned (among other things). Is that not the > case? I believe that's the case; bvecs are logical_block_size aligned. So the new thing (with data_unit_size > logical_block_size) is that bvec boundaries aren't necessarily valid split points anymore. > > If it is the case, that's what we're trying to avoid with this patch (we > want to be able to submit bios that have 2 bvecs that together make up a > single crypto data unit, for example). And this is complex because > multiple segments could "add up" to make up a single crypto data unit, > but this function's job is to limit both the number of segments *and* > the number of sectors - so when ensuring that the number of sectors is > aligned to crypto data unit size, we also want the smallest number of > segments that can make up that aligned number of sectors. Does the number of physical segments that is calculated have to be exact, or could it be a slight overestimate? If the purpose of the calculation is just to size scatterlists and to avoid exceeding the hardware limit on the number of physical segments (and at a quick glance that seems to be the purpose, though I didn't look at everything), it seems that a slight overestimate would be okay. If so, couldn't the number of sectors could simply be rounded down to blk_crypto_bio_sectors_alignment(bio) when blk_bio_segment_split() actually calls bio_split()? That would be much simpler; why doesn't that work? - Eric

[RFC][PATCH] coredump: Document coredump code exclusively used by cell spufs

2020-11-25 Thread Eric W. Biederman
tor table isn't shared") [3] git://sourceware.org/git/binutils-gdb.git [4] abf516c6931a ("Remove Cell Broadband Engine debugging support"). Signed-off-by: Eric W. Biederman --- Does this change look good to people? I think it captures this state of things and makes things c

Re: UAPI value collision: STATX_ATTR_MOUNT_ROOT vs STATX_ATTR_DAX

2020-11-25 Thread Eric Sandeen
about exactly what attributes_mask means, so should STATX_ATTR_DAX be set in statx->attributes_mask only in the filesystems that support dax? (And should that be done only if CONFIG_DAX is turned on, etc?) -Eric

Re: [PATCH] xfs: check the return value of krealloc() in xfs_uuid_mount

2020-11-25 Thread Eric Sandeen
1) * sizeof(*xfs_uuid_table), > GFP_KERNEL | __GFP_NOFAIL); > + if (!if_xfs_uuid_table) > + goto out_duplicate; And this would emit "Filesystem has duplicate UUID" which is not correct. But anyway, the __GFP_NOFAIL in the call makes this

Re: [PATCH v2 02/24] exec: Simplify unshare_files

2020-11-24 Thread Eric W. Biederman
Geoff Levand writes: > On 11/24/20 12:14 PM, Arnd Bergmann wrote: >> On Tue, Nov 24, 2020 at 8:58 PM Linus Torvalds >> wrote: >>> >>> On Tue, Nov 24, 2020 at 11:55 AM Eric W. Biederman >>> wrote: >>>> >>>> If cell happens to be

Re: [RESEND PATCH v1] proc: use untagged_addr() for pagemap_read addresses

2020-11-24 Thread Eric W. Biederman
I suspect the proper way to handle this is to move the test for overflow earlier so the code looks something like: end_vaddr = mm->task_size; src = *ppos; svpfn = src / PM_ENTRY_BYTES; /* watch out for wraparound */ start_vaddr = end_vaddr; if (svpfn < (ULONG_MAX >> PAGE_SHIFT)) start_vaddr = untagged_addr(svpfn << PAGE_SHIFT); /* Ensure the address is inside the task */ if (start_vaddr > mm->task_size) start_vaddr = end_vaddr; Eric

Re: [PATCH v11 08/13] vfio/pci: Add framework for custom interrupt indices

2020-11-24 Thread Auger Eric
Hi Shameer, Qubingbing On 11/23/20 1:51 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message----- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 11:00 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >&

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-23 Thread Eric Biggers
On Tue, Nov 24, 2020 at 08:02:21AM +0900, Daeho Jeong wrote: > Jaegeuk, > > My mistake~ > > Eric, > > What I want is like do_page_cache_ra(), but I used > page_cache_ra_unbounded() directly, because we already checked that > read is within i_size. > > Or we cou

Re: [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-23 Thread Eric Biggers
ops required under the circumstances. > > > > Since the fscrypt d_ops are set later on, we must set all d_ops there, > > since we cannot adjust those later on. This should not result in any > > change in behavior. > > > > Signed-off-by: Daniel Rosenbe

Re: [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-23 Thread Eric Biggers
+FOUND" instead (the directory is casefolded after all...), then e2fsck can't find it. Unless there's a real use case for the root directory being casefolded and people are willing to fix e2fsck, I think we should just make ext4 return an error when setting the casefold flag on the root directory, like it does when trying to enable encryption on the root directory. - Eric

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-23 Thread Eric Biggers
_COMPRESS_OPTION: > return f2fs_ioc_set_compress_option(filp, arg); > + case F2FS_IOC_DECOMPRESS_FILE: > + return f2fs_ioc_decompress_file(filp, arg); > + case F2FS_IOC_COMPRESS_FILE: > + return f2fs_ioc_compress_file(filp, arg); > default: > return -ENOTTY; > } Where is the documentation and tests for these new ioctls? - Eric

Re: [f2fs-dev] [PATCH 1/2] f2fs: add compress_mode mount option

2020-11-23 Thread Eric Biggers
and gives the user discretion of choosing the target > file and > + the timing. The user can do manual > compression/decompression > + on the compression enabled files using ioctls. Please clarify in the documentation what it means for compression-enabled files to not be compressed. It is not obvious. - Eric

Re: [PATCH v8] tcp: fix race condition when creating child sockets from syncookies

2020-11-23 Thread Eric Dumazet
t; socket exists, we drop the packet and discard the second child socket > to the same client. > > Signed-off-by: Ricardo Dias Ok, lets keep this version, thanks ! Signed-off-by: Eric Dumazet

[PATCH v2 22/24] file: Replace ksys_close with close_fd

2020-11-20 Thread Eric W. Biederman
Now that ksys_close is exactly identical to close_fd replace the one caller of ksys_close with close_fd. [1] https://lkml.kernel.org/r/20200818112020.ga17...@infradead.org Suggested-by: Christoph Hellwig Signed-off-by: "Eric W. Biederman" --- fs/autofs/dev-ioctl.c| 5 +++-- inc

[PATCH v2 14/24] file: Implement task_lookup_next_fd_rcu

2020-11-20 Thread Eric W. Biederman
https://lkml.kernel.org/r/20200817220425.9389-9-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 21 + include/linux/fdtable.h | 1 + 2 files changed, 22 insertions(+) diff --git a/fs/file.c b/fs/file.c index 6448523ca29e..23b888a4acbe 100644

[PATCH v2 23/24] file: Rename __close_fd_get_file close_fd_get_file

2020-11-20 Thread Eric W. Biederman
close() during fdget()") Signed-off-by: Eric W. Biederman --- drivers/android/binder.c | 2 +- fs/file.c| 4 ++-- fs/io_uring.c| 2 +- include/linux/fdtable.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/android/binder.c b/drive

[PATCH v2 17/24] proc/fd: In fdinfo seq_show don't use get_files_struct

2020-11-20 Thread Eric W. Biederman
v1: https://lkml.kernel.org/r/20200817220425.9389-12-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/proc/fd.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 72c1525b4b3e..cb51763ed554 100644 --- a/fs/proc/fd.c

[PATCH v2 13/24] kcmp: In get_file_raw_ptr use task_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
Modify get_file_raw_ptr to use task_lookup_fd_rcu. The helper task_lookup_fd_rcu does the work of taking the task lock and verifying that task->files != NULL and then calls files_lookup_fd_rcu. So let use the helper to make a simpler implementation of get_file_raw_ptr. Signed-off-by: &quo

[PATCH v2 20/24] file: Merge __alloc_fd into alloc_fd

2020-11-20 Thread Eric W. Biederman
[1] dcfadfa4ec5a ("new helper: __alloc_fd()") [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-16-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/file.c

[PATCH v2 16/24] bpf/task_iter: In task_file_seq_get_next use task_lookup_next_fd_rcu

2020-11-20 Thread Eric W. Biederman
0915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov v1: https://lkml.kernel.org/r/20200817220425.9389-11-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- kernel/bpf/task_iter.c | 44 ++ 1 file changed, 10 insertions(+), 34 deletions(-)

[PATCH v2 12/24] proc/fd: In tid_fd_mode use task_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
://lkml.kernel.org/r/20200817220425.9389-7-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/proc/fd.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 3dec44d7c5c5..c1a984f3c4df 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c

[PATCH v2 15/24] proc/fd: In proc_readfd_common use task_lookup_next_fd_rcu

2020-11-20 Thread Eric W. Biederman
a31...@redhat.com Suggested-by: Oleg Nesterov Tested-by: Andy Lavr v1: https://lkml.kernel.org/r/20200817220425.9389-10-ebied...@xmission.com Signed-off-by: Eric W. Biederman --- fs/proc/fd.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/proc/fd.c b/fs/proc/f

[PATCH v2 11/24] file: Implement task_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
As a companion to lookup_fd_rcu implement task_lookup_fd_rcu for querying an arbitrary process about a specific file. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200818103713.aw46m7vprsy4vlve@wittgenstein Signed-off-by: "Eric W. Biederman" --- fs/file.c

[PATCH v2 18/24] file: Merge __fd_install into fd_install

2020-11-20 Thread Eric W. Biederman
t->files. [1] f869e8a7f753 ("expose a low-level variant of fd_install() for binder") [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") Acked-by: Christian Brauner v1:https://lkml.kernel.org/r/20200817220425.9389-14-ebied...@xmission.com Signed-off-by: "Eric W. Bied

[PATCH v2 24/24] file: Remove get_files_struct

2020-11-20 Thread Eric W. Biederman
and fget_light remove get_files_struct so that it does not gain any new users. [1] https://lkml.kernel.org/r/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-13-ebied...@xmission.com Signed-off-by: "E

[PATCH v2 21/24] file: Rename __close_fd to close_fd and remove the files parameter

2020-11-20 Thread Eric W. Biederman
t;files. [1] 483ce1d4b8c3 ("take descriptor-related part of close() to file.c") [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-17-ebied...@xmission.com Signed-off-by: &qu

[PATCH v2 19/24] file: In f_dupfd read RLIMIT_NOFILE once.

2020-11-20 Thread Eric W. Biederman
. Further this causes alloc_fd to take all of the same arguments as __alloc_fd except for the files_struct argument. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-15-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 9 + 1 file

[PATCH v2 09/24] file: Replace fcheck_files with files_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
und of discussion of this set of changes[1]. [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- Documentation/filesystems/files.rst | 6 +++--- fs/file.c | 4 ++--

[PATCH v2 10/24] file: Rename fcheck lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- Documentation/filesystems/files.rst | 6 +++--- arch/powerpc/platforms/cell/spufs/coredump.c | 2 +- fs/notify/dnotify/dnotify.c

[PATCH v2 06/24] proc/fd: In proc_fd_link use fget_task

2020-11-20 Thread Eric W. Biederman
. [1] https://lkml.kernel.org/r/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov v1: https://lkml.kernel.org/r/20200817220425.9389-8-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/proc/fd.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletion

[PATCH v2 08/24] file: Factor files_lookup_fd_locked out of fcheck_files

2020-11-20 Thread Eric W. Biederman
il.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 2 +- fs/locks.c | 14 -- fs/proc/fd.c| 2 +- include/linux/fdtable.h | 7 +++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/fs/file.c b/fs/file.c in

[PATCH v2 07/24] file: Rename __fcheck_files to files_lookup_fd_raw

2020-11-20 Thread Eric W. Biederman
und of discussion of this set of changes[1]. [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 2 +- include/linux/fdtable.h | 4 ++-- 2 files changed, 3 insertions(+), 3

[PATCH v2 04/24] kcmp: In kcmp_epoll_target use fget_task

2020-11-20 Thread Eric W. Biederman
fget_light having to fallback to fget reducing performance. Suggested-by: Oleg Nesterov Reviewed-by: Cyrill Gorcunov v1: https://lkml.kernel.org/r/20200817220425.9389-4-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- kernel/kcmp.c | 20 1 file

[PATCH v2 05/24] bpf: In bpf_task_fd_query use fget_task

2020-11-20 Thread Eric W. Biederman
/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov v1: https://lkml.kernel.org/r/20200817220425.9389-5-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- kernel/bpf/syscall.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/kernel/bpf

[PATCH v2 02/24] exec: Simplify unshare_files

2020-11-20 Thread Eric W. Biederman
/r/20200817220425.9389-2-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/coredump.c | 5 + fs/exec.c | 5 + include/linux/fdtable.h | 2 +- kernel/fork.c | 12 ++-- 4 files changed, 9 insertions(+), 15 deletions(-) di

[PATCH v2 03/24] exec: Remove reset_files_struct

2020-11-20 Thread Eric W. Biederman
Now that exec no longer needs to restore the previous value of current->files on error there are no more callers of reset_files_struct so remove it. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-3-ebied...@xmission.com Signed-off-by: "Eric W. Biederman&q

[PATCH v2 01/24] exec: Move unshare_files to fix posix file locking during exec

2020-11-20 Thread Eric W. Biederman
0172423.21964-1-jlay...@kernel.org [16] https://lkml.kernel.org/r/20180914105310.6454-1-jlay...@kernel.org [17] https://lkml.kernel.org/r/87a7ohs5ow@xmission.com [18] https://lkml.kernel.org/r/87pn8c1uj6.fsf...@x220.int.ebiederm.org Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/2

Re: [PATCH] random: initialize ChaCha20 constants with correct endianness

2020-11-20 Thread Eric Biggers
On Mon, Oct 26, 2020 at 09:33:54AM -0700, Eric Biggers wrote: > On Tue, Oct 06, 2020 at 08:51:45PM -0700, Eric Biggers wrote: > > On Fri, Sep 18, 2020 at 02:57:05PM -0700, Eric Biggers wrote: > > > On Fri, Sep 18, 2020 at 04:42:07PM -0400, Theodore Y. Ts'o wrote: > >

<    3   4   5   6   7   8   9   10   11   12   >