lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <20071026115958.GK5155@kernel.dk> Date: Fri, 26 Oct 2007 13:59:58 +0200 From: Jens Axboe <jens.axboe@...cle.com> To: Anton Blanchard <anton@...ba.org> Cc: linux-kernel@...r.kernel.org Subject: Re: [PATCH] Initialise scatter/gather list in sg driver On Thu, Oct 25 2007, Anton Blanchard wrote: > > After turning on DEBUG_SG I hit a fail: > > kernel BUG at include/linux/scatterlist.h:50! > > sg_build_indirect > sg_build_reserve > sg_open > chrdev_open > __dentry_open > do_filp_open > do_sys_open > > We should initialise the sg list when we allocate it in sg_build_sgat. > > Signed-off-by: Anton Blanchard <anton@...ba.org> > --- > > diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c > index b5fa4f0..f1871ea 100644 > --- a/drivers/scsi/sg.c > +++ b/drivers/scsi/sg.c > @@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize) > schp->buffer = kzalloc(sg_bufflen, gfp_flags); > if (!schp->buffer) > return -ENOMEM; > + sg_init_table(schp->buffer, tablesize); > schp->sglist_len = sg_bufflen; > return tablesize; /* number of scat_gath elements allocated */ > } Thanks, applied! -- Jens Axboe - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists