Project

General

Profile

Actions

Submit #2907

closed

Extend IOCPARM_MAX

Added by tkusumi over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/30/2016
Due date:
% Done:

0%

Estimated time:

Description

Matt,

I'd like to bring in this diff from FreeBSD which extends IOCPARM_MAX size.
This patch was originally added for ZFS in 2010.
https://leaf.dragonflybsd.org/~tkusumi/diff/598dc07f.patch

Larger IOCPARM_MAX is necessary to port autofs to DragonFly.
Without this, autofs ioctl fails at mapped_ioctl() with ENOTTY as the ioctl structure size exceeds IOCPARM_MAX which is page size.

667         /*
668 * Interpret high order word to find amount of data to be
669 * copied to/from the user's address space.
670 */
671 size = IOCPARM_LEN(com);
672 if (size > IOCPARM_MAX) {
673 error = ENOTTY;
674 goto done;
675 }

Autofs header could define the structure using, say (MAXPATHLEN / 2) instead of MAXPATHLEN in order to just pass this test,
which still seems large enough in most cases, but it may break portability of userspace config files.
https://github.com/freebsd/freebsd/blob/master/sys/fs/autofs/autofs_ioctl.h

Actions #1

Updated by tkusumi over 8 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF