summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-03-29 11:49:33 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-03-29 11:49:33 +0000
commit146e9006bf817e3ac5687ee53192f36478fbf440 (patch)
tree0f4a9592101c4e2e1408ddab79bc65b705012245
parentf90d2470a9e7a4d7d5ed54ae4b8a91c93bc212ec (diff)
parenta7d0884d71898c1977a10cdb2235307e2eb9b20e (diff)
downloadillumos-joyent-146e9006bf817e3ac5687ee53192f36478fbf440.tar.gz
[illumos-gate merge]
commit a7d0884d71898c1977a10cdb2235307e2eb9b20e 6752 E_SUPPRESSION_DIRECTIVE_UNUSED lint warnings on SPARC build commit c3862f21bea547737e494d7e7ff98c21a3490e6f 6830 ipkg brand config.xml needs smb privileges commit 258e8624229ac7ff3af9890752a92cd251b83825 5895 mdb_alloc() succeeds for 4294967295 bytes in 32-bit process
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_umem.c7
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_umem.h17
-rw-r--r--usr/src/lib/brand/ipkg/zone/config.xml3
-rw-r--r--usr/src/uts/common/io/usb/clients/usbser/usbser.c1
-rw-r--r--usr/src/uts/common/io/usb/clients/usbser/usbser_rseq.c1
-rw-r--r--usr/src/uts/intel/usbser/Makefile1
-rw-r--r--usr/src/uts/sparc/fcp/Makefile3
7 files changed, 22 insertions, 11 deletions
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_umem.c b/usr/src/cmd/mdb/common/mdb/mdb_umem.c
index d293e2d898..3b387d570c 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_umem.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_umem.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* These routines simply provide wrappers around malloc(3C) and free(3C)
* for now. In the future we hope to provide a userland equivalent to
@@ -169,11 +167,14 @@ void *
mdb_alloc_align(size_t nbytes, size_t align, uint_t flags)
{
void *ptr;
+ size_t obytes = nbytes;
- if (nbytes == 0)
+ if (nbytes == 0 || nbytes > MDB_ALLOC_MAX)
return (NULL);
nbytes = (nbytes + sizeof (uint32_t) - 1) & ~(sizeof (uint32_t) - 1);
+ if (nbytes < obytes || nbytes == 0)
+ return (NULL);
if (align != 0)
ptr = memalign(align, nbytes);
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_umem.h b/usr/src/cmd/mdb/common/mdb/mdb_umem.h
index c06e143fab..bc3e0b40a6 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_umem.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb_umem.h
@@ -27,9 +27,8 @@
#ifndef _MDB_UMEM_H
#define _MDB_UMEM_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
+#include <limits.h>
#ifdef __cplusplus
extern "C" {
@@ -48,6 +47,20 @@ extern void mdb_free_align(void *, size_t);
extern void mdb_recycle(mdb_mblk_t **);
+/*
+ * These values represent an attempt to help constrain dmods that have bugs and
+ * have accidentally underflowed their size arguments. They represent
+ * allocations that are impossible.
+ */
+#if defined(_ILP32)
+#define MDB_ALLOC_MAX INT32_MAX
+#elif defined(_LP64)
+#define MDB_ALLOC_MAX INT64_MAX
+#else
+#error "Unknown data model"
+#endif
+
+
#endif /* _MDB */
#ifdef __cplusplus
diff --git a/usr/src/lib/brand/ipkg/zone/config.xml b/usr/src/lib/brand/ipkg/zone/config.xml
index e7307bfd8a..48857db50b 100644
--- a/usr/src/lib/brand/ipkg/zone/config.xml
+++ b/usr/src/lib/brand/ipkg/zone/config.xml
@@ -89,8 +89,9 @@
<privilege set="default" name="sys_iptun_config" ip-type="exclusive" />
<privilege set="default" name="sys_mount" />
<privilege set="default" name="sys_nfs" />
- <privilege set="default" name="sys_resource" />
<privilege set="default" name="sys_ppp_config" ip-type="exclusive" />
+ <privilege set="default" name="sys_resource" />
+ <privilege set="default" name="sys_smb" />
<privilege set="prohibited" name="dtrace_kernel" />
<privilege set="prohibited" name="proc_zone" />
diff --git a/usr/src/uts/common/io/usb/clients/usbser/usbser.c b/usr/src/uts/common/io/usb/clients/usbser/usbser.c
index 5262ff39a2..a020d50708 100644
--- a/usr/src/uts/common/io/usb/clients/usbser/usbser.c
+++ b/usr/src/uts/common/io/usb/clients/usbser/usbser.c
@@ -1865,7 +1865,6 @@ usbser_thr_dispatch(usbser_thread_t *thr)
{
usbser_port_t *pp = thr->thr_port;
usbser_state_t *usp = pp->port_usp;
- /*LINTED E_FUNC_SET_NOT_USED*/
int rval;
ASSERT(mutex_owned(&pp->port_mutex));
diff --git a/usr/src/uts/common/io/usb/clients/usbser/usbser_rseq.c b/usr/src/uts/common/io/usb/clients/usbser/usbser_rseq.c
index 69256e96c8..75eb5bda11 100644
--- a/usr/src/uts/common/io/usb/clients/usbser/usbser_rseq.c
+++ b/usr/src/uts/common/io/usb/clients/usbser/usbser_rseq.c
@@ -34,7 +34,6 @@
#include <sys/debug.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
-/*LINTED E_STATIC_UNUSED*/
static long rseq_random();
#define random rseq_random
#else
diff --git a/usr/src/uts/intel/usbser/Makefile b/usr/src/uts/intel/usbser/Makefile
index 836d3c21a2..a4aa5057fe 100644
--- a/usr/src/uts/intel/usbser/Makefile
+++ b/usr/src/uts/intel/usbser/Makefile
@@ -67,7 +67,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
# Please do not carry these forward to new Makefiles.
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
.KEEP_STATE:
diff --git a/usr/src/uts/sparc/fcp/Makefile b/usr/src/uts/sparc/fcp/Makefile
index 00ba41c328..ddc705e0ba 100644
--- a/usr/src/uts/sparc/fcp/Makefile
+++ b/usr/src/uts/sparc/fcp/Makefile
@@ -63,11 +63,10 @@ LDFLAGS += -dy -Nmisc/fctl -Nmisc/scsi
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
-LINTTAGS += -erroff=E_STATIC_UNUSED
+LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-unused-function
CERRWARN += -_gcc=-Wno-uninitialized
#