On Wed, Nov 13, 2013 at 03:08:12PM +0300, Dan Carpenter wrote: > On Wed, Nov 13, 2013 at 11:52:37AM +0000, Vikas Chaudhary wrote: > > > > > > -----Original Message----- > > From: Dan Carpenter <dan.carpen...@oracle.com> > > Date: Wednesday, 13 November 2013 1:18 pm > > To: Vikas <vikas.chaudh...@qlogic.com>, Adheer Chandravanshi > > <adheer.chandravan...@qlogic.com> > > Cc: Dept-Eng iSCSI Driver <dept-iscsidri...@qlogic.com>, "James E.J. > > Bottomley" <jbottom...@parallels.com>, scsi <linux-scsi@vger.kernel.org>, > > "kernel-janit...@vger.kernel.org" <kernel-janit...@vger.kernel.org> > > Subject: [patch] [SCSI] qla4xxx: overflow in qla4xxx_set_chap_entry() > > > > >We should cap the size of memcpy() because it comes from the network > > >and can't be trusted. > > > > This patch is on assumption that data is coming from network, > > but in this case data come from application (iscsiadm) with correct length. > > > > No, that doesn't work. We don't trust user space.
Btw, the is especially true with network namespaces... These days anyone who is ns_capable() could overflow the buffer after: df008c91f835 ('net: Allow userns root to control llc, netfilter, netlink, packet, and xfrm') regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html