Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-29 Thread Mimi Zohar
My apologies for those receiving this post a 2nd time. The original post never made it the mailing lists ... On Fri, 2014-04-25 at 15:25 -0700, Eric W. Biederman wrote: > Al Viro writes: > > > On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: > > > >> ssize_t

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-29 Thread Mimi Zohar
My apologies for those receiving this post a 2nd time. The original post never made it the mailing lists ... On Fri, 2014-04-25 at 15:25 -0700, Eric W. Biederman wrote: Al Viro v...@zeniv.linux.org.uk writes: On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: ssize_t

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 20:42, Al Viro wrote: > On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: >> On 26 April 2014 16:56, Al Viro wrote: >> > On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: >> > >> >> Conflict with Apparmor means with Ubuntu. >> >> >> >> But answering

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Al Viro
On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: > On 26 April 2014 16:56, Al Viro wrote: > > On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: > > > >> Conflict with Apparmor means with Ubuntu. > >> > >> But answering to your early question.. > >> IMA does not want

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 16:56, Al Viro wrote: > On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: > >> Conflict with Apparmor means with Ubuntu. >> >> But answering to your early question.. >> IMA does not want permission denied when measuring and re-measuring files. >> may_open() is

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Al Viro
On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: > Conflict with Apparmor means with Ubuntu. > > But answering to your early question.. > IMA does not want permission denied when measuring and re-measuring files. > may_open() is doing that job before. > > We need quickly

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:38, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> Is it really a show stopper to switch order of 2 functions as quick fix? >> It was like that before 3.10 and seemed ok... > > When that is the question. The answer is yes it is a show stopper. > > A quick fix to

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:11, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 26 April 2014 00:27, Eric W. Biederman wrote: >>> Dmitry Kasatkin writes: >>> On 25 April 2014 23:45, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 25 April 2014 23:01, Oleg

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:11, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 01:38, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: Is it really a show stopper to switch order of 2 functions as quick fix? It was like that before 3.10 and seemed ok... When that is the question. The answer is yes it is

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Al Viro
On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means with Ubuntu. But answering to your early question.. IMA does not want permission denied when measuring and re-measuring files. may_open() is doing that job before. We need quickly introduce

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 16:56, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means with Ubuntu. But answering to your early question.. IMA does not want permission denied when measuring and re-measuring files.

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Al Viro
On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: On 26 April 2014 16:56, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means with Ubuntu. But answering to your early question.. IMA does

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-26 Thread Dmitry Kasatkin
On 26 April 2014 20:42, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 07:54:47PM +0300, Dmitry Kasatkin wrote: On 26 April 2014 16:56, Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Apr 26, 2014 at 11:58:45AM +0300, Dmitry Kasatkin wrote: Conflict with Apparmor means with

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin writes: > Is it really a show stopper to switch order of 2 functions as quick fix? > It was like that before 3.10 and seemed ok... When that is the question. The answer is yes it is a show stopper. A quick fix to bury a fundamental design flaw because the code previously

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Al Viro writes: > On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: > >> ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, loff_t >> *pos) >> { >> ssize_t ret; >> >> if (!(file->f_mode & FMODE_READ)) >> return -EBADF; >> if

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin writes: > On 26 April 2014 00:27, Eric W. Biederman wrote: >> Dmitry Kasatkin writes: >> >>> On 25 April 2014 23:45, Eric W. Biederman wrote: Dmitry Kasatkin writes: > On 25 April 2014 23:01, Oleg Nesterov wrote: >> On 04/25, Eric W. Biederman wrote:

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:46, Dmitry Kasatkin wrote: > On 26 April 2014 00:27, Eric W. Biederman wrote: >> Dmitry Kasatkin writes: >> >>> On 25 April 2014 23:45, Eric W. Biederman wrote: Dmitry Kasatkin writes: > On 25 April 2014 23:01, Oleg Nesterov wrote: >> On 04/25, Eric W.

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Al Viro
On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: > ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, loff_t > *pos) > { > ssize_t ret; > > if (!(file->f_mode & FMODE_READ)) > return -EBADF; > if (!file->f_op->read &&

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:27, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 25 April 2014 23:45, Eric W. Biederman wrote: >>> Dmitry Kasatkin writes: >>> On 25 April 2014 23:01, Oleg Nesterov wrote: > On 04/25, Eric W. Biederman wrote: >> >> Oleg Nesterov writes:

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Al Viro writes: > On Fri, Apr 25, 2014 at 01:45:17PM -0700, Eric W. Biederman wrote: > >> IMA-appraisal is fundamentally broken because I can take a mandatory >> file lock and prevent IMA-apprasial. >> >> Using kernel_read is what allows this. >> >> > Isn't it a clear motivating case??? >> >>

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin writes: > On 25 April 2014 23:45, Eric W. Biederman wrote: >> Dmitry Kasatkin writes: >> >>> On 25 April 2014 23:01, Oleg Nesterov wrote: On 04/25, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > Well. I _think_ that __fput() and ima_file_free()

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Al Viro
On Fri, Apr 25, 2014 at 01:45:17PM -0700, Eric W. Biederman wrote: > IMA-appraisal is fundamentally broken because I can take a mandatory > file lock and prevent IMA-apprasial. > > Using kernel_read is what allows this. > > > Isn't it a clear motivating case??? > > kernel_read is not

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:45, Eric W. Biederman wrote: > Dmitry Kasatkin writes: > >> On 25 April 2014 23:01, Oleg Nesterov wrote: >>> On 04/25, Eric W. Biederman wrote: Oleg Nesterov writes: > Well. I _think_ that __fput() and ima_file_free() in particular should > not

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin writes: > On 25 April 2014 23:01, Oleg Nesterov wrote: >> On 04/25, Eric W. Biederman wrote: >>> >>> Oleg Nesterov writes: >>> >>> > Well. I _think_ that __fput() and ima_file_free() in particular should not >>> > depend on current and/or current->nsproxy. If nothing else,

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:01, Oleg Nesterov wrote: > On 04/25, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > Well. I _think_ that __fput() and ima_file_free() in particular should not >> > depend on current and/or current->nsproxy. If nothing else, fput() can be >> > called by the

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > Well. I _think_ that __fput() and ima_file_free() in particular should not > > depend on current and/or current->nsproxy. If nothing else, fput() can be > > called by the unrelated task which looks into /proc/pid/. > > > > But

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/25, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > Eric, this makes me think again that we should do exit_task_namespaces() >> > after exit_task_work(). We already discussed this before, but this looks >> > like another indication this change makes

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > Eric, this makes me think again that we should do exit_task_namespaces() > > after exit_task_work(). We already discussed this before, but this looks > > like another indication this change makes sense. > > I know you mentioned

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Oleg Nesterov writes: > On 04/25, Dmitry Kasatkin wrote: >> >> On 25/04/14 16:00, Dmitry Kasatkin wrote: >> > Hello, >> > >> > I discovered a kernel panic on system running Ubuntu when IMA is enabled. >> > It happens on reboot. >> > >> > -- >> > [ 106.750100] NSPROXY is

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Dmitry Kasatkin wrote: > > On 25/04/14 16:00, Dmitry Kasatkin wrote: > > Hello, > > > > I discovered a kernel panic on system running Ubuntu when IMA is enabled. > > It happens on reboot. > > > > -- > > [ 106.750100] NSPROXY is NULL: error.log

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 16:00, Dmitry Kasatkin wrote: > Hello, > > I discovered a kernel panic on system running Ubuntu when IMA is enabled. > It happens on reboot. > > -- > [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) > [ 106.750167] BUG: unable to handle kernel

Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL pointer dereference at 0018 [

Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL pointer dereference at 0018 [

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25/04/14 16:00, Dmitry Kasatkin wrote: Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [ 106.750167] BUG: unable to handle kernel NULL

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Dmitry Kasatkin wrote: On 25/04/14 16:00, Dmitry Kasatkin wrote: Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log (/var/log/mysql/error.log) [

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Oleg Nesterov o...@redhat.com writes: On 04/25, Dmitry Kasatkin wrote: On 25/04/14 16:00, Dmitry Kasatkin wrote: Hello, I discovered a kernel panic on system running Ubuntu when IMA is enabled. It happens on reboot. -- [ 106.750100] NSPROXY is NULL: error.log

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Eric, this makes me think again that we should do exit_task_namespaces() after exit_task_work(). We already discussed this before, but this looks like another indication this change makes sense. I know you

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Oleg Nesterov o...@redhat.com writes: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Eric, this makes me think again that we should do exit_task_namespaces() after exit_task_work(). We already discussed this before, but this looks like another indication this

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Oleg Nesterov
On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput() and ima_file_free() in particular should not depend on current and/or current-nsproxy. If nothing else, fput() can be called by the unrelated task which looks into /proc/pid/. But

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput() and ima_file_free() in particular should not depend on current and/or current-nsproxy. If nothing else, fput() can be called

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput() and ima_file_free() in particular should not depend on current and/or

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov o...@redhat.com writes: Well. I _think_ that __fput() and

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Al Viro
On Fri, Apr 25, 2014 at 01:45:17PM -0700, Eric W. Biederman wrote: IMA-appraisal is fundamentally broken because I can take a mandatory file lock and prevent IMA-apprasial. Using kernel_read is what allows this. Isn't it a clear motivating case??? kernel_read is not appropriate for

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov o...@redhat.com wrote: On 04/25, Eric W. Biederman wrote: Oleg Nesterov

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Al Viro v...@zeniv.linux.org.uk writes: On Fri, Apr 25, 2014 at 01:45:17PM -0700, Eric W. Biederman wrote: IMA-appraisal is fundamentally broken because I can take a mandatory file lock and prevent IMA-apprasial. Using kernel_read is what allows this. Isn't it a clear motivating

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:01, Oleg Nesterov

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Al Viro
On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { ssize_t ret; if (!(file-f_mode FMODE_READ)) return -EBADF; if (!file-f_op-read !file-f_op-aio_read)

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Dmitry Kasatkin
On 26 April 2014 00:46, Dmitry Kasatkin dmitry.kasat...@gmail.com wrote: On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 26 April 2014 00:27, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes: On 25 April 2014 23:45, Eric W. Biederman ebied...@xmission.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com writes:

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Al Viro v...@zeniv.linux.org.uk writes: On Fri, Apr 25, 2014 at 02:43:42PM -0700, Eric W. Biederman wrote: ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { ssize_t ret; if (!(file-f_mode FMODE_READ)) return -EBADF; if

Re: Kernel panic at Ubuntu: IMA + Apparmor

2014-04-25 Thread Eric W. Biederman
Dmitry Kasatkin dmitry.kasat...@gmail.com writes: Is it really a show stopper to switch order of 2 functions as quick fix? It was like that before 3.10 and seemed ok... When that is the question. The answer is yes it is a show stopper. A quick fix to bury a fundamental design flaw because