summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2013-08-16 14:27:29 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2013-08-16 14:27:29 +0000
commitd48e19307a3e50ed051a75b60b72dab8ddcfb27e (patch)
tree8c16ff3f6491f8eeae36242aeb3253f18d280006 /sys
parente2233471d26dbc4873aac0e003bca50a13ee6e05 (diff)
int overflow in sector calculation, broke UDF reads past 2GB. Diff promotes
sector to daddr_t before calculation to avoid overflow. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/isofs/udf/udf.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/isofs/udf/udf.h b/sys/isofs/udf/udf.h
index a0babd9b624..f7167061d36 100644
--- a/sys/isofs/udf/udf.h
+++ b/sys/isofs/udf/udf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf.h,v 1.17 2013/05/30 17:35:01 guenther Exp $ */
+/* $OpenBSD: udf.h,v 1.18 2013/08/16 14:27:28 mlarkin Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -109,7 +109,8 @@ struct udf_dirstream {
* Can the block layer be forced to use a different block size?
*/
#define RDSECTOR(devvp, sector, size, bp) \
- bread(devvp, ((sector) << ump->um_bshift) / DEV_BSIZE, size, bp)
+ bread(devvp, \
+ ((daddr_t)(sector) << ump->um_bshift) / DEV_BSIZE, size, bp)
static __inline int