Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756872Ab2EAXLf (ORCPT ); Tue, 1 May 2012 19:11:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60893 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755231Ab2EAXLe (ORCPT ); Tue, 1 May 2012 19:11:34 -0400 Date: Tue, 1 May 2012 16:11:31 -0700 From: Andrew Morton To: KOSAKI Motohiro Cc: Doug Ledford , linux-kernel@vger.kernel.org, sfr@canb.auug.org.au Subject: Re: [Patch 3/4] ipc/mqueue: strengthen checks on mqueue creation Message-Id: <20120501161131.90a9967a.akpm@linux-foundation.org> In-Reply-To: <4FA06C15.7000500@gmail.com> References: <1335894655-11398-1-git-send-email-dledford@redhat.com> <4FA04131.2040004@gmail.com> <4FA04373.6090100@redhat.com> <4FA06BA2.7020703@redhat.com> <4FA06C15.7000500@gmail.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1030 Lines: 32 On Tue, 01 May 2012 19:04:53 -0400 KOSAKI Motohiro wrote: > > OK, then would EOVERFLOW suit things better? > > I have no seen to any confusion source this. thank you. --- a/ipc/mqueue.c~ipc-mqueue-strengthen-checks-on-mqueue-creation-fix +++ a/ipc/mqueue.c @@ -687,13 +687,13 @@ static int mq_attr_ok(struct ipc_namespa } /* check for overflow */ if (attr->mq_msgsize > ULONG_MAX/attr->mq_maxmsg) - return -ENOMEM; + return -EOVERFLOW; mq_treesize = attr->mq_maxmsg * sizeof(struct msg_msg) + min_t(unsigned int, attr->mq_maxmsg, MQ_PRIO_MAX) * sizeof(struct posix_msg_tree_node); total_size = attr->mq_maxmsg * attr->mq_msgsize; if (total_size + mq_treesize < total_size) - return -ENOMEM; + return -EOVERFLOW; return 0; } _ -- 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/