Re: [RFC PATCH] ptrace: make ptrace() fail if the tracee changed its pid unexpectedly

2020-12-17 Thread Eric W. Biederman
ange seems sensible. I don't expect this is common but it looks painful to deal with if it happens. Acked-by: "Eric W. Biederman" I am wondering if this should be expanded to all ptrace types for consistency. Or maybe we should set a flag to make this happen for all ptrace events. It jus

Re: [Bug 210655] ptrace.2: documentation is incorrect about access checking threads in same thread group

2020-12-17 Thread Eric W. Biederman
"Alejandro Colomar (man-pages)" writes: > [CC += Thomas, Ingo, Peter, Darren] > > Hi Oleg, > > On 12/16/20 3:33 AM, Jann Horn wrote: >> On Wed, Dec 16, 2020 at 3:21 AM Ted Estes wrote: >>> On 12/15/2020 6:01 PM, Jann Horn wrote: On Wed, Dec 16, 2020 at 12:25 AM Alejandro Colomar

Re: [GIT PULL] exec fixes for v5.11-rc1

2020-12-16 Thread Eric W. Biederman
Linus Torvalds writes: > On Tue, Dec 15, 2020 at 3:00 PM Eric W. Biederman > wrote: >> >> There is a minor conflict with parallel changes to the bpf task_iter >> code. The changes don't fundamentally conflict but both are removing >> code from same area

[GIT PULL] exec-update-lock for v5.11

2020-12-15 Thread Eric W. Biederman
transform exec_update_mutex into a rw_semaphore so readers can be separated from writers. This makes it easier to understand what the holders of the lock are doing, and makes it harder to contend or deadlock on the lock. The real deadlock fix wound up in perf_event_open. Eric W. Biederman (3):

[GIT PULL] exec fixes for v5.11-rc1

2020-12-15 Thread Eric W. Biederman
ready for the merge window so that will have to wait until next time. Eric W. Biederman (28): exec: Don't open code get_close_on_exec exec: Move unshare_files to fix posix file locking during exec exec: Simplify unshare_files exec: Remove reset_files_struct kcmp

[GIT PULL] signal enhancements for v5.11-rc1

2020-12-15 Thread Eric W. Biederman
e are fine for the forseeable future. Eric W. Biederman (1): signal/parisc: Remove parisc specific definition of __ARCH_UAPI_SA_FLAGS Helge Deller (1): parisc: Drop parisc special case for __sighandler_t Peter Collingbourne (6): parisc: start using signal-defs.h arch: move SA_* definitions

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

2020-12-15 Thread Eric W. Biederman
Casey Schaufler writes: > On 12/13/2020 3:00 PM, Paul Moore wrote: >> On Sun, Dec 13, 2020 at 11:30 AM Matthew Wilcox wrote: >>> On Sun, Dec 13, 2020 at 08:22:32AM -0600, Eric W. Biederman wrote: >>>> Matthew Wilcox writes: >>>> >>>>>

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

2020-12-15 Thread Eric W. Biederman
Stephen Brennan writes: > ebied...@xmission.com (Eric W. Biederman) writes: > >> Stephen Brennan writes: >> >>> The pid_revalidate() function requires dropping from RCU into REF lookup >>> mode. When many threads are resolving paths within /proc in pa

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

2020-12-13 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 lock (and drop

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

2020-12-13 Thread Eric W. Biederman
Matthew Wilcox writes: > On Thu, Dec 03, 2020 at 04:02:12PM -0800, Stephen Brennan wrote: >> -void pid_update_inode(struct task_struct *task, struct inode *inode) >> +static int do_pid_update_inode(struct task_struct *task, struct inode >> *inode, >> + unsigned int

Re: [PATCH] perf: Break deadlock involving exec_update_mutex

2020-12-10 Thread Eric W. Biederman
Davidlohr Bueso writes: > On Tue, 08 Dec 2020, Peter Zijlstra wrote: > >>I suppose I'll queue the below into tip/perf/core for next merge window, >>unless you want it in a hurry? > > I'm thinking we'd still want Eric's series on top of this for the reader > benefits of the lock. We will see

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-10 Thread Eric W. Biederman
Peter Zijlstra writes: > On Tue, Dec 08, 2020 at 12:27:39PM -0600, Eric W. Biederman wrote: >> Peter Zijlstra writes: >> >> > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: >> > >> >> Do you want to pull these two into a topic

Re: [PATCH] files: rcu free files_struct

2020-12-10 Thread Eric W. Biederman
Al Viro writes: > On Wed, Dec 09, 2020 at 03:32:38PM -0600, Eric W. Biederman wrote: >> Al Viro writes: >> >> > On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote: >> >> On Wed, Dec 9, 2020 at 10:0

Re: [PATCH] files: rcu free files_struct

2020-12-09 Thread Eric W. Biederman
Matthew Wilcox writes: > On Wed, Dec 09, 2020 at 12:04:38PM -0600, Eric W. Biederman wrote: >> @@ -397,8 +397,9 @@ static struct fdtable *close_files(struct files_struct * >> files) >> set = fdt->open_fds[j++]; >> while (set) { >&

Re: [PATCH] files: rcu free files_struct

2020-12-09 Thread Eric W. Biederman
Linus Torvalds writes: > On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman > wrote: >> >> - struct file * file = xchg(>fd[i], NULL); >> + struct file * file = fdt->fd[i]; >>

Re: Review request 0/1: fs/proc: Fix NULL pointer dereference in

2020-12-09 Thread Eric W. Biederman
Yahu Gao writes: > There is a kernel NULL pointer dereference was found in Linux system. > The details of kernel NULL is shown at bellow. > > Currently, we do not have a way to provoke this fault on purpose, but > the reproduction rate in out CI loops is high enough that we could go > for a

[PATCH -1/24] exec: Don't open code get_close_on_exec

2020-12-09 Thread Eric W. Biederman
comes equivalent the helper function get_close_on_exec so simplify the code and make it more robust by simply using get_close_on_exec. [1] https://lkml.kernel.org/r/2020120714.ga4115...@zeniv.linux.org.uk Suggested-by: Al Viro Signed-off-by: Eric W. Biederman --- I aim to rebase my exec

Re: [PATCH] files: rcu free files_struct

2020-12-09 Thread Eric W. Biederman
Al Viro writes: > On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote: >> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman >> wrote: >> > >> > - struct file * file = xchg(>fd[i], >> > NULL); >> &

[tip: locking/core] rwsem: Implement down_read_interruptible

2020-12-09 Thread tip-bot2 for Eric W. Biederman
The following commit has been merged into the locking/core branch of tip: Commit-ID: 31784cff7ee073b34d6eddabb95e3be2880a425c Gitweb: https://git.kernel.org/tip/31784cff7ee073b34d6eddabb95e3be2880a425c Author:Eric W. Biederman AuthorDate:Thu, 03 Dec 2020 14:11:13 -06:00

[tip: locking/core] rwsem: Implement down_read_killable_nested

2020-12-09 Thread tip-bot2 for Eric W. Biederman
The following commit has been merged into the locking/core branch of tip: Commit-ID: 0f9368b5bf6db0c04afc5454b1be79022a681615 Gitweb: https://git.kernel.org/tip/0f9368b5bf6db0c04afc5454b1be79022a681615 Author:Eric W. Biederman AuthorDate:Thu, 03 Dec 2020 14:10:32 -06:00

[PATCH] files: rcu free files_struct

2020-12-09 Thread Eric W. Biederman
This makes it safe to deference task->files with just rcu_read_lock held, removing the need to take task_lock. Signed-off-by: Eric W. Biederman --- I have cleaned up my patch a little more and made this a little more explicitly rcu. I took a completley different approach to document

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread Eric W. Biederman
Peter Zijlstra writes: > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: > >> Do you want to pull these two into a topic branch in the tip tree >> based on v10-rc1? > > I'll go do that. I'll let the robots chew on it before pushing it out > t

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread Eric W. Biederman
Peter Zijlstra writes: > On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: >> On 12/3/20 3:11 PM, Eric W. Biederman wrote: > >> > +static inline int __down_read_interruptible(struct rw_semaphore *sem) >> > +{ >> > + if (!rwsem_read_try

Re: [RFC PATCH v2] do_exit(): panic() recursion detected

2020-12-07 Thread Eric W. Biederman
Vladimir Kondratiev writes: > Please ignore version 1 of the patch - it was sent from wrong mail address. > > To clarify the reason: > > Situation where do_exit() re-entered, discovered by static code analysis. > For safety critical system, it is better to panic() when minimal chance of >

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

2020-12-05 Thread Eric W. Biederman
Davidlohr Bueso writes: > On Fri, 04 Dec 2020, Linus Torvalds wrote: > >>On Fri, Dec 4, 2020 at 12:30 PM Bernd Edlinger >> wrote: >>> >perf_event_open (exec_update_mutex -> ovl_i_mutex) >> >>Side note: this one looks like it should be easy to fix. >> >>Is there any real reason why

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

2020-12-05 Thread Eric W. Biederman
Linus Torvalds writes: > On Fri, Dec 4, 2020 at 11:35 AM Eric W. Biederman > wrote: >> >> From a deadlock perspective the change is strictly better than what we >> have today. The readers will no longer block on each other. > > No, agreed, it's better regardle

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

2020-12-04 Thread Eric W. Biederman
Linus Torvalds writes: > On Fri, Dec 4, 2020 at 8:08 AM Bernd Edlinger > wrote: >> >> > >> > -static void kcmp_unlock(struct mutex *m1, struct mutex *m2) >> > +static void kcmp_unlock(struct rw_semaphore *l1, struct rw_semaphore *l2) >> > { >> > - if (likely(m2 != m1)) >> > -

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

2020-12-04 Thread Eric W. Biederman
ct code is also correct code on RT-linux. If not it is an RT-linux bug. An rw_semaphore may be less than optimal on RT-linux. I do remember that mutexes are prefered. But this change is more about correctness than anything else. > On 12/3/20 9:12 PM, Eric W. Biederman wrote: >> --- a/kerne

[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
it 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: [PATCH] pid: add null pointer check in pid_nr_ns()

2020-12-02 Thread Eric W. Biederman
Alakesh Haloi writes: > There has been at least one occurrence where a null pointer derefernce > panic was seen with following stack trace. > > #0 [ff800bcd3800] machine_kexec at ff8008095fb4 > #1 [ff800bcd3860] __crash_kexec at ff8008122a30 > #2 [ff800bcd39f0] panic at

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.

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 v3] drivers/virt: vmgenid: add vm generation id driver

2020-12-01 Thread Eric W. Biederman
"Catangiu, Adrian Costin" writes: > - Background > > The VM Generation ID is a feature defined by Microsoft (paper: > http://go.microsoft.com/fwlink/?LinkId=260709) and supported by > multiple hypervisor vendors. > > The feature is required in virtualized environments by apps that work > with

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

2020-12-01 Thread Eric W. Biederman
Nit: The tag should have been "userns:" rather than kernel. Giuseppe Scrivano writes: > writing to the id map fails when an extent overlaps multiple mappings > in the parent user namespace, e.g.: > > $ cat /proc/self/uid_map > 0 1000 1 > 1 10

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 ``regressio

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

2020-11-30 Thread Eric W. Biederman
Alakesh Haloi writes: > There has been at least one occurrence where a null pointer derefernce > panic was seen with following stack trace. > > #0 [ff800bcd3800] machine_kexec at ff8008095fb4 > #1 [ff800bcd3860] __crash_kexec at ff8008122a30 > #2 [ff800bcd39f0] panic at

[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 'Hacker' forum

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

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
syzbot writes: > syzbot has found a reproducer for the following issue on: > > HEAD commit:99c710c4 Merge tag 'platform-drivers-x86-v5.10-2' of git:/.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=12a77ddd50 > kernel config:

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

2020-11-30 Thread Eric W. Biederman
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.kernel.org > --- &g

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

2020-11-30 Thread Eric W. Biederman
dded. 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 trivial fix to my signal-f

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

2020-11-30 Thread Eric W. Biederman
Stephen Rothwell writes: > Hi all, > > On Fri, 27 Nov 2020 10:43:07 -0800 Randy Dunlap wrote: >> >> On 11/27/20 1:04 AM, Stephen Rothwell wrote: >> > Hi all, >> > >> > Changes since 20201126: >> > >> >> on parisc, _SA_SIGGFAULT is undefined and causing build errors. >> >> commit

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

2020-11-26 Thread Eric W. Biederman
Stephen Rothwell writes: > Hi all, > > Today's linux-next merge of the userns tree got a conflict in: > > kernel/bpf/task_iter.c > > between commit: > > 91b2db27d3ff ("bpf: Simplify task_file_seq_get_next()") > > from the bpf-next tree and commit: > > edc52f17257a ("bpf/task_iter: In

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

2020-11-25 Thread Eric W. Biederman
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 clearer witho

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

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

2020-11-24 Thread Eric W. Biederman
Miles Chen writes: > When we try to visit the pagemap of a tagged userspace pointer, we find > that the start_vaddr is not correct because of the tag. > To fix it, we should untag the usespace pointers in pagemap_read(). > > I tested with 5.10-rc4 and the issue remains. > > My test code is baed

[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
://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 --- a

[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
...@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(-) diff --git a/

[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
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 deletions(-) diff

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

2020-11-20 Thread Eric W. Biederman
in 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(-)

[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
23.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/202008

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-17 Thread Eric W. Biederman
Thomas Gleixner writes: > On Tue, Nov 17 2020 at 12:19, David Woodhouse wrote: >> On Tue, 2020-11-17 at 10:53 +0100, Thomas Gleixner wrote: >>> But that does not solve the problem either simply because then the IOMMU >>> will catch the rogue MSIs and you get an interrupt storm on the IOMMU >>>

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-16 Thread Eric W. Biederman
Bjorn Helgaas writes: > I don't think passing the device information to the kdump kernel is > really practical. The kdump kernel would use it to do PCI config > writes to disable MSIs before enabling IRQs, and it doesn't know how > to access config space that early. I don't think it is

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-16 Thread Eric W. Biederman
ed > callbacks in the PCI hotplug add/del path to update this information). > > [a] > https://lore.kernel.org/lkml/1588812129-8596-1-git-send-email-anthony.yzn...@oracle.com/ > > Below, inline reply to Eric's last message. > > > On 15/11/2020 17:46, Eric W. Bi

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-15 Thread Eric W. Biederman
Thomas Gleixner writes: > On Sun, Nov 15 2020 at 08:29, Eric W. Biederman wrote: >> ebied...@xmission.com (Eric W. Biederman) writes: >> For ordinary irqs you can have this with level triggered irqs >> and the kernel has code that will shutdown the irq at the ioapic >&

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-15 Thread Eric W. Biederman
ebied...@xmission.com (Eric W. Biederman) writes: > Bjorn Helgaas writes: > >> [+cc Rafael for question about ACPI method for PCI host bridge reset] >> >> On Sat, Nov 14, 2020 at 09:58:08PM +0100, Thomas Gleixner wrote: >>> On Sat, Nov 14 2020 at 14:39, Bjorn He

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-15 Thread Eric W. Biederman
Bjorn Helgaas writes: > [+cc Rafael for question about ACPI method for PCI host bridge reset] > > On Sat, Nov 14, 2020 at 09:58:08PM +0100, Thomas Gleixner wrote: >> On Sat, Nov 14 2020 at 14:39, Bjorn Helgaas wrote: >> > On Sat, Nov 14, 2020 at 12:40:10AM +0100, Thomas Gleixner wrote: >> >> On

Re: [RESEND PATCH v3] fuse: Abort waiting for a response if the daemon receives a fatal signal

2020-11-10 Thread Eric W. Biederman
Miklos Szeredi writes: > On Mon, Nov 9, 2020 at 7:54 PM Eric W. Biederman > wrote: >> >> Miklos Szeredi writes: >> >> > On Mon, Nov 9, 2020 at 1:48 PM Alexey Gladkov >> > wrote: >> >> >> >> This patch removes one kind of t

Re: [RESEND PATCH v3] fuse: Abort waiting for a response if the daemon receives a fatal signal

2020-11-09 Thread Eric W. Biederman
Miklos Szeredi writes: > On Mon, Nov 9, 2020 at 1:48 PM Alexey Gladkov > wrote: >> >> This patch removes one kind of the deadlocks inside the fuse daemon. The >> problem appear when the fuse daemon itself makes a file operation on its >> filesystem and receives a fatal signal. >> >> This

Re: [PATCH -next] fs: Fix memory leaks in do_renameat2() error paths

2020-11-03 Thread Eric W. Biederman
Jens Axboe writes: > On 11/2/20 1:31 PM, Jens Axboe wrote: >> On 11/2/20 1:12 PM, Eric W. Biederman wrote: >>> Jens Axboe writes: >>> >>>> On 11/2/20 12:27 PM, Eric W. Biederman wrote: >>>>> Jens Axboe writes: >>>>> >>

Re: [PATCH -next] fs: Fix memory leaks in do_renameat2() error paths

2020-11-02 Thread Eric W. Biederman
Jens Axboe writes: > On 11/2/20 12:27 PM, Eric W. Biederman wrote: >> Jens Axboe writes: >> >>> On 10/30/20 4:22 PM, Al Viro wrote: >>>> On Fri, Oct 30, 2020 at 02:33:11PM -0600, Jens Axboe wrote: >>>>> On 10/30/20 12:49 PM, Al Viro wrote: &g

Re: [PATCH -next] fs: Fix memory leaks in do_renameat2() error paths

2020-11-02 Thread Eric W. Biederman
Jens Axboe writes: > On 10/30/20 4:22 PM, Al Viro wrote: >> On Fri, Oct 30, 2020 at 02:33:11PM -0600, Jens Axboe wrote: >>> On 10/30/20 12:49 PM, Al Viro wrote: On Fri, Oct 30, 2020 at 12:46:26PM -0600, Jens Axboe wrote: > See other reply, it's being posted soon, just haven't

Re: [PATCH -next] fs: Fix memory leaks in do_renameat2() error paths

2020-11-02 Thread Eric W. Biederman
Jens Axboe writes: > On 10/30/20 4:22 PM, Al Viro wrote: >> On Fri, Oct 30, 2020 at 02:33:11PM -0600, Jens Axboe wrote: >>> On 10/30/20 12:49 PM, Al Viro wrote: On Fri, Oct 30, 2020 at 12:46:26PM -0600, Jens Axboe wrote: > See other reply, it's being posted soon, just haven't

Re: [PATCH v18 0/4] overlayfs override_creds=off & nested get xattr fix

2020-10-21 Thread Eric W. Biederman
> Cc: Jonathan Corbet > Cc: Vivek Goyal > Cc: Eric W. Biederman > Cc: Amir Goldstein > Cc: Randy Dunlap > Cc: Stephen Smalley > Cc: John Stultz > Cc: linux-...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > To: linux-fsde...@vger.kernel.org > To: li

[RFC][PATCH] userns: Limit process in a user namespace to what the creator is allowed

2020-10-19 Thread Eric W. Biederman
was created, while still supporting explicitly specified users and groups to have fewer permissions. Signed-off-by: Eric W. Biederman --- So far only generic_permission is covered, but I think this demonstrates that the goal is achievable. Preserving negative acls while allowing setuid and setgroups

Re: The problem of setgroups and containers

2020-10-18 Thread Eric W. Biederman
ebied...@xmission.com (Eric W. Biederman) writes: > [ Added linux-api because we are talking about a subtle semantic > change to the permission checks ] > > Christian Brauner writes: > >> On Sat, Oct 17, 2020 at 11:51:22AM -0500, Eric W. Biederman wrote: >>> &qu

The problem of setgroups and containers

2020-10-18 Thread Eric W. Biederman
[ Added linux-api because we are talking about a subtle semantic change to the permission checks ] Christian Brauner writes: > On Sat, Oct 17, 2020 at 11:51:22AM -0500, Eric W. Biederman wrote: >> "Enrico Weigelt, metux IT consult" writes: >> >> > On 30.08

Re: LPC 2020 Hackroom Session: summary and next steps for isolated user namespaces

2020-10-17 Thread Eric W. Biederman
"Enrico Weigelt, metux IT consult" writes: > On 30.08.20 16:39, Christian Brauner wrote: > > Hi Christian, > >> P1. Isolated id mappings can only be guaranteed to be locally isolated. >> A container runtime/daemon can only guarantee non-overlapping id mappings >> when no other users on

Re: LPC 2020 Hackroom Session: summary and next steps for isolated user namespaces

2020-10-17 Thread Eric W. Biederman
"Serge E. Hallyn" writes: > On Wed, Oct 14, 2020 at 02:46:46PM -0500, Eric W. Biederman wrote: >> "Serge E. Hallyn" writes: >> >> > On Mon, Oct 12, 2020 at 12:01:09AM -0500, Eric W. Biederman wrote: >> >> Andy Lutomirski writes: >

Re: LPC 2020 Hackroom Session: summary and next steps for isolated user namespaces

2020-10-14 Thread Eric W. Biederman
"Serge E. Hallyn" writes: > On Mon, Oct 12, 2020 at 12:01:09AM -0500, Eric W. Biederman wrote: >> Andy Lutomirski writes: >> >> > On Sun, Oct 11, 2020 at 1:53 PM Josh Triplett >> > wrote: >> >> >> >> On Fri, Oct 09, 2020

Re: LPC 2020 Hackroom Session: summary and next steps for isolated user namespaces

2020-10-11 Thread Eric W. Biederman
Andy Lutomirski writes: > On Sun, Oct 11, 2020 at 1:53 PM Josh Triplett wrote: >> >> On Fri, Oct 09, 2020 at 11:26:06PM -0500, Serge E. Hallyn wrote: >> > > 3. Find a way to allow setgroups() in a user namespace while keeping >> > >in mind the case of groups used for negative access

Re: [PATCH RFC PKS/PMEM 51/58] kernel: Utilize new kmap_thread()

2020-10-09 Thread Eric W. Biederman
ira.we...@intel.com writes: > From: Ira Weiny > > This kmap() call is localized to a single thread. To avoid the over > head of global PKRS updates use the new kmap_thread() call. Acked-by: "Eric W. Biederman" > > Cc: Eric Biederman > Signed-off-by: Ira Wein

Re: WARNING in get_signal

2020-10-02 Thread Eric W. Biederman
syzbot writes: > Hello, > > syzbot found the following issue on: So this is: static void do_jobctl_trap(void) { struct signal_struct *signal = current->signal; int signr = current->jobctl & JOBCTL_STOP_SIGMASK; if (current->ptrace & PT_SEIZED) { if

Re: [PATCH] Only allow to set crash_kexec_post_notifiers on boot time

2020-09-24 Thread Eric W. Biederman
(See below, didn't snip any comments) >> > On 09/21/20 at 08:45pm, Eric W. Biederman wrote: >> > > Konrad Rzeszutek Wilk writes: >> > > >> > > > On Fri, Sep 18, 2020 at 05:47:43PM -0700, Andrew Morton wrote: >> > > >> On Fri, 18 S

Re: [PATCH] Only allow to set crash_kexec_post_notifiers on boot time

2020-09-21 Thread Eric W. Biederman
Konrad Rzeszutek Wilk writes: > On Fri, Sep 18, 2020 at 05:47:43PM -0700, Andrew Morton wrote: >> On Fri, 18 Sep 2020 11:25:46 +0800 Dave Young wrote: >> >> > crash_kexec_post_notifiers enables running various panic notifier >> > before kdump kernel booting. This increases risks of kdump

Re: [PATCH] fork: Use helper function mapping_allow_writable() in dup_mmap()

2020-09-14 Thread Eric W. Biederman
linmiaohe writes: > Eric W. Biederman wrote: >> Miaohe Lin writes: >> >>> Use helper function mapping_allow_writable() to atomic_inc >>> i_mmap_writable. >> >>Why? >> > > Because I think it's better to use the wrapper function instead

<    1   2   3   4   5   6   7   8   9   10   >