mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 08:52:46 +00:00
Loosen up the constructed argument segment generation slightly; rather than
trying to size it intelligently just make it 64k and leave it up to the caller to ensure that the arguments all fit within that range. This should resolve the issue that some people were seeing with the PnP BIOS scan crashing on a large PnP node.
This commit is contained in:
parent
89f6acf96a
commit
f996ef6395
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50094
@ -24,7 +24,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: bios.c,v 1.16 1999/08/17 07:10:29 msmith Exp $
|
* $Id: bios.c,v 1.17 1999/08/18 02:19:52 msmith Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -287,13 +287,6 @@ set_bios_selectors(struct bios_segments *seg, int flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* for pointers, we don't know how much space is supposed to be allocated,
|
|
||||||
* so we assume a minimum size of 256 bytes. If more than this is needed,
|
|
||||||
* then this can be revisited, such as adding a length specifier.
|
|
||||||
*/
|
|
||||||
#define ASSUMED_ARGSIZE 256
|
|
||||||
|
|
||||||
extern int vm86pa;
|
extern int vm86pa;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -329,7 +322,7 @@ bios16(struct bios_args *args, char *fmt, ...)
|
|||||||
case 'p': /* 32-bit pointer */
|
case 'p': /* 32-bit pointer */
|
||||||
i = va_arg(ap, u_int);
|
i = va_arg(ap, u_int);
|
||||||
arg_start = min(arg_start, i);
|
arg_start = min(arg_start, i);
|
||||||
arg_end = max(arg_end, i + ASSUMED_ARGSIZE);
|
arg_end = max(arg_end, i);
|
||||||
flags |= BIOSARGS_FLAG;
|
flags |= BIOSARGS_FLAG;
|
||||||
stack -= 4;
|
stack -= 4;
|
||||||
break;
|
break;
|
||||||
@ -361,7 +354,7 @@ bios16(struct bios_args *args, char *fmt, ...)
|
|||||||
if (arg_end - arg_start > ctob(16))
|
if (arg_end - arg_start > ctob(16))
|
||||||
return (EACCES);
|
return (EACCES);
|
||||||
args->seg.args.base = arg_start;
|
args->seg.args.base = arg_start;
|
||||||
args->seg.args.limit = arg_end - arg_start;
|
args->seg.args.limit = 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
|
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: bios.c,v 1.16 1999/08/17 07:10:29 msmith Exp $
|
* $Id: bios.c,v 1.17 1999/08/18 02:19:52 msmith Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -287,13 +287,6 @@ set_bios_selectors(struct bios_segments *seg, int flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* for pointers, we don't know how much space is supposed to be allocated,
|
|
||||||
* so we assume a minimum size of 256 bytes. If more than this is needed,
|
|
||||||
* then this can be revisited, such as adding a length specifier.
|
|
||||||
*/
|
|
||||||
#define ASSUMED_ARGSIZE 256
|
|
||||||
|
|
||||||
extern int vm86pa;
|
extern int vm86pa;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -329,7 +322,7 @@ bios16(struct bios_args *args, char *fmt, ...)
|
|||||||
case 'p': /* 32-bit pointer */
|
case 'p': /* 32-bit pointer */
|
||||||
i = va_arg(ap, u_int);
|
i = va_arg(ap, u_int);
|
||||||
arg_start = min(arg_start, i);
|
arg_start = min(arg_start, i);
|
||||||
arg_end = max(arg_end, i + ASSUMED_ARGSIZE);
|
arg_end = max(arg_end, i);
|
||||||
flags |= BIOSARGS_FLAG;
|
flags |= BIOSARGS_FLAG;
|
||||||
stack -= 4;
|
stack -= 4;
|
||||||
break;
|
break;
|
||||||
@ -361,7 +354,7 @@ bios16(struct bios_args *args, char *fmt, ...)
|
|||||||
if (arg_end - arg_start > ctob(16))
|
if (arg_end - arg_start > ctob(16))
|
||||||
return (EACCES);
|
return (EACCES);
|
||||||
args->seg.args.base = arg_start;
|
args->seg.args.base = arg_start;
|
||||||
args->seg.args.limit = arg_end - arg_start;
|
args->seg.args.limit = 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
|
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
|
||||||
|
Loading…
Reference in New Issue
Block a user