Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751590AbaDYVzU (ORCPT ); Fri, 25 Apr 2014 17:55:20 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60240 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbaDYVzS (ORCPT ); Fri, 25 Apr 2014 17:55:18 -0400 Date: Fri, 25 Apr 2014 22:55:09 +0100 From: Al Viro To: "Eric W. Biederman" Cc: Dmitry Kasatkin , Oleg Nesterov , Dmitry Kasatkin , linux-security-module , John Johansen , Mimi Zohar , James Morris , Linux Kernel Mailing List , kernel-team Subject: Re: Kernel panic at Ubuntu: IMA + Apparmor Message-ID: <20140425215509.GD18016@ZenIV.linux.org.uk> References: <535A75C1.3050901@samsung.com> <20140425182310.GA9128@redhat.com> <87sip15iy5.fsf@x220.int.ebiederm.org> <20140425192543.GA11908@redhat.com> <878uqt42q7.fsf@x220.int.ebiederm.org> <20140425200156.GA13727@redhat.com> <874n1h16le.fsf@x220.int.ebiederm.org> <20140425212128.GB18016@ZenIV.linux.org.uk> <87ppk5w0dt.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ppk5w0dt.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > return -EINVAL; > if (unlikely(!access_ok(VERIFY_WRITE, buf, count))) > return -EFAULT; > > if (ret >= 0) { > count = ret; > if (file->f_op->read) > ret = file->f_op->read(file, buf, count, pos); > else > ret = do_sync_read(file, buf, count, pos); > } > > return ret; > } ... which lacks the f_pos wraparound, etc. checks done by rw_verify_area(). IOW, it's one more place to grep through while verifying that ->read() et.al. do not get called with such arguments. fanotify probably could be skipped - ask the security circus crowd about that one, it's their bast^Wbaby. add_rchar() and inc_syscr()... depends on whether you want those reads hidden from accounting. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/