Received: from mnm [127.0.0.1] by localhost with POP3 (fetchmail-5.9.0) for akpm@localhost (single-drop); Sat, 15 Feb 2003 15:16:36 -0800 (PST) Received: by mangalore (mbox akpm) (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Feb 16 10:15:55 2003) X-From_: linux-kernel-owner+akpm=40zip.com.au@vger.kernel.org Sun Feb 16 10:13:50 2003 Return-Path: Received: from vger.kernel.org (vger.kernel.org [209.116.70.75]) by mangalore.zipworld.com.au (8.12.3/8.12.3) with ESMTP id h1FNDmeQ008237 for ; Sun, 16 Feb 2003 10:13:48 +1100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 15 Feb 2003 18:02:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 15 Feb 2003 18:02:16 -0500 Received: from hera.cwi.nl ([192.16.191.8]:17358 "EHLO hera.cwi.nl") by vger.kernel.org with ESMTP id ; Sat, 15 Feb 2003 18:02:14 -0500 Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id AAA08085 for ; Sun, 16 Feb 2003 00:12:03 +0100 (MET) From: Andries.Brouwer@cwi.nl Received: by apps.cwi.nl id h1FNC3804597; Sun, 16 Feb 2003 00:12:03 +0100 (MET) Date: Sun, 16 Feb 2003 00:12:03 +0100 (MET) Message-Id: To: torvalds@transmeta.com Subject: [PATCH] nfsd patch Cc: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-Spam-Status: No, hits=-4.5 required=6.0 tests=NO_REAL_NAME,UNIFIED_PATCH version=2.31 X-Spam-Level: Remove MAX_BLKDEV from nfsd. diff -u --recursive --new-file -X /linux/dontdiff a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c --- a/fs/nfsd/nfs3proc.c Fri Nov 22 22:40:29 2002 +++ b/fs/nfsd/nfs3proc.c Sat Feb 15 21:16:14 2003 @@ -317,11 +317,10 @@ if (argp->ftype == 0 || argp->ftype >= NF3BAD) RETURN_STATUS(nfserr_inval); if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) { - if ((argp->ftype == NF3CHR && argp->major >= MAX_CHRDEV) - || (argp->ftype == NF3BLK && argp->major >= MAX_BLKDEV) - || argp->minor > 0xFF) - RETURN_STATUS(nfserr_inval); rdev = MKDEV(argp->major, argp->minor); + if (MAJOR(rdev) != argp->major || + MINOR(rdev) != argp->minor) + RETURN_STATUS(nfserr_inval); } else if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO) RETURN_STATUS(nfserr_inval); diff -u --recursive --new-file -X /linux/dontdiff a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c --- a/fs/nfsd/nfs4proc.c Thu Jan 9 18:07:16 2003 +++ b/fs/nfsd/nfs4proc.c Sat Feb 15 21:25:43 2003 @@ -264,6 +264,7 @@ { struct svc_fh resfh; int status; + dev_t rdev; fh_init(&resfh, NFS4_FHSIZE); @@ -288,21 +289,23 @@ break; case NF4BLK: - if (create->cr_specdata1 >= MAX_BLKDEV || create->cr_specdata2 > 0xFF) + rdev = MKDEV(create->cr_specdata1, create->cr_specdata2); + if (MAJOR(rdev) != create->cr_specdata1 || + MINOR(rdev) != create->cr_specdata2) return nfserr_inval; status = nfsd_create(rqstp, current_fh, create->cr_name, - create->cr_namelen, &create->cr_iattr, S_IFBLK, - MKDEV(create->cr_specdata1, create->cr_specdata2), - &resfh); + create->cr_namelen, &create->cr_iattr, + S_IFBLK, rdev, &resfh); break; case NF4CHR: - if (create->cr_specdata1 >= MAX_CHRDEV || create->cr_specdata2 > 0xFF) + rdev = MKDEV(create->cr_specdata1, create->cr_specdata2); + if (MAJOR(rdev) != create->cr_specdata1 || + MINOR(rdev) != create->cr_specdata2) return nfserr_inval; status = nfsd_create(rqstp, current_fh, create->cr_name, - create->cr_namelen, &create->cr_iattr, S_IFCHR, - MKDEV(create->cr_specdata1, create->cr_specdata2), - &resfh); + create->cr_namelen, &create->cr_iattr, + S_IFCHR, rdev, &resfh); break; case NF4SOCK: - 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/