RETURNED MAIL: SEE TRANSCRIPT FOR DETAILS
IªG«±ô«ª?¦þtw2õèÚÁ*âVgÉûm h§µ ÔÂYºÅ·ìÉG±?Eéâ$B2ÙFi²úørnÍçÔ§S1»ÆwÜR òmúýúF?¤Êª}KO˲RȲqQûá·tU W5{ïaiÜuVOþÕÚÚ¿,ûLµÊÓðêußêTÄÀÍÇàTbÞU*(8¼(_xxïSoK$F(ÅUP÷´~näïÕçãði%Û¬í´Á/1ÑA«duR:ÆûÉ鸣7¾·D»ø.DúsÖ _îkz .¶bâ½Òh]µ #Ñ£ÖýÐEü)á?#fØåÖ.Õ<Q{;È.ûï¸Vw5 Ç3Hé¢éFw¨äe`uA?Ùû9;"7oÂÄ(äÜßÑäÜV{AìÜVo^yìCôW°CãJ÷íL[ 0É6<é X´`À¬DÞã'Ǥ¶ôxÁæ(B¿æ°çZªyú?µ§ÅC½²Áðð¤Êñ%øÐwÆÑÅ´çvÝ45 {õH©;lëÚ¦2ÝEßéô¸û|`XK·(é9þs#O?kCïGSçÜZ3ö\s §E8Qú 9¤â°`úêVûïiq74¹%;îQ&åq'Ï' ¸UIÇÞBQÊ&8áìÔc¤ä2¡Òn/uË×|]AèºUE ]§v0(.Y¥î}ýQ¹J*¨ 3g°ÝM©EpÊ|ïÎ?z%.5F÷]oë®]¨Loì6-¹}~1Ù9UexAU"ñóB¾ÐdìyFáeNiòÎSsYªa³Zöס¡&·ÚmÆæÒÀr0D{9ÊXB²[GmÒÔ ¯kº&*ÒàgÂ¥7PÄÅÝ° %LU$A7ÉáÕù³xÅÉ¿ãß5-ûØ£M¦CàÐTIܾ4EÕzqÒ?ëö®¨ý¾OÕT TµÕÔ4 Ë )`ÝÖ-úX¡ze¯ð{wjóù¢Rw*î¢mÕ~'hÓ²ÉtÒÕqVPö$Eã逸.«®Pzæϯ>ãà ÎçM:þiU©LæYZ_^·ØÇÚ·ÏÜòË®i0^vǨ!:×]¢ØnñOð!ç÷Ð-Æ6tÌ! í£nÉþ:;ÇCÈLê¢-m3| Rñç;íEÎíx¸´Ä³þê! ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [PATCH] nvdimm: move the check on nd_reserved2 to the endpoint
On Mon, Sep 4, 2017 at 8:34 AM, Meng Xuwrote: > This patch delays the check of nd_reserved2 to the actual endpoint > (acpi_nfit_ctl) that uses it, as a prevention of a potential > double-fetch bug. > > Detailed discussion can be found at > https://marc.info/?l=linux-kernel=150421938113092=2 Thanks for doing this, I went ahead and copied this discussion into the patch and applied it. ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [PATCH] dax: fix FS_DAX=n BLOCK=y compilation
On Mon, Sep 4, 2017 at 3:26 AM, Jan Karawrote: > On Sun 03-09-17 10:25:55, Dan Williams wrote: >> The 0day kbuild robot reports: >> >> >> drivers//dax/super.c:64:20: error: redefinition of 'fs_dax_get_by_bdev' >> struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) >>^~ >>In file included from drivers//dax/super.c:22:0: >>include/linux/dax.h:76:34: note: previous definition of >> 'fs_dax_get_by_bdev' was here >> static inline struct dax_device *fs_dax_get_by_bdev(struct block_device >> *bdev) >> ^~ >> >> Protect the definition of fs_dax_get_by_bdev() in drivers/dax/super.c >> with an ifdef. >> >> Fixes: 78f354735081 ("dax: introduce a fs_dax_get_by_bdev() helper") >> Cc: Jan Kara >> Cc: Christoph Hellwig >> Cc: Darrick J. Wong >> Reported-by: kbuild test robot >> Signed-off-by: Dan Williams > > OK, or you could have both !DAX and DAX implementations in > include/linux/dax.h as inline together? It would look a bit more logical to > me. But I don't care much. So > > Reviewed-by: Jan Kara My motivation for not doing that is to avoid including blkdev.h from dax.h. ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [PATCH] nvdimm: fix potential double-fetch bug
Hi Dan, I have adjusted the patch as suggested by moving the check on nd_reserved2 to acpi_nfit_ctl(). The new patch can be found at https://marc.info/?l=linux-kernel=150453930712916=2 Best Regards, Meng On 08/31/2017 06:42 PM, Dan Williams wrote: [ adding Jerry ] On Wed, Aug 23, 2017 at 2:07 PM, Meng Xuwrote: From: Meng Xu While examining the kernel source code, I found a dangerous operation that could turn into a double-fetch situation (a race condition bug) where the same userspace memory region are fetched twice into kernel with sanity checks after the first fetch while missing checks after the second fetch. In the case of _IOC_NR(ioctl_cmd) == ND_CMD_CALL: 1. The first fetch happens in line 935 copy_from_user(, p, sizeof(pkg) 2. subsequently `pkg.nd_reserved2` is asserted to be all zeroes (line 984 to 986). 3. The second fetch happens in line 1022 copy_from_user(buf, p, buf_len) 4. Given that `p` can be fully controlled in userspace, an attacker can race condition to override the header part of `p`, say, `((struct nd_cmd_pkg *)p)->nd_reserved2` to arbitrary value (say nine 0x for `nd_reserved2`) after the first fetch but before the second fetch. The changed value will be copied to `buf`. 5. There is no checks on the second fetches until the use of it in line 1034: nd_cmd_clear_to_send(nvdimm_bus, nvdimm, cmd, buf) and line 1038: nd_desc->ndctl(nd_desc, nvdimm, cmd, buf, buf_len, _rc) which means that the assumed relation, `p->nd_reserved2` are all zeroes might not hold after the second fetch. And once the control goes to these functions we lose the context to assert the assumed relation. 6. Based on my manual analysis, `p->nd_reserved2` is not used in function `nd_cmd_clear_to_send` and potential implementations of `nd_desc->ndctl` so there is no working exploit against it right now. However, this could easily turns to an exploitable one if careless developers start to use `p->nd_reserved2` later and assume that they are all zeroes. Proposed patch: The patch explicitly overrides `buf->nd_reserved2` after the second fetch with the value `pkg.nd_reserved2` from the first fetch. In this way, it is assured that the relation, `buf->nd_reserved2` are all zeroes, holds after the second fetch. Signed-off-by: Meng Xu --- drivers/nvdimm/bus.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 937fafa..20c4d0f 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -1024,6 +1024,12 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, goto out; } + if (cmd == ND_CMD_CALL) { + struct nd_cmd_pkg *hdr = (struct nd_cmd_pkg *)buf; + memcpy(hdr->nd_reserved2, pkg.nd_reserved2, + sizeof(pkg.nd_reserved2)); + } + I think we're ok because the end point like acpi_nfit_ctl() is responsible for re-validating the buffer. So what I would rather like to see is deleting this loop: for (i = 0; i < ARRAY_SIZE(pkg.nd_reserved2); i++) if (pkg.nd_reserved2[i]) return -EINVAL; ...from __nd_ioctl() and move it into acpi_nfit_ctl() directly where it belongs. ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
[PATCH] nvdimm: move the check on nd_reserved2 to the endpoint
This patch delays the check of nd_reserved2 to the actual endpoint (acpi_nfit_ctl) that uses it, as a prevention of a potential double-fetch bug. Detailed discussion can be found at https://marc.info/?l=linux-kernel=150421938113092=2 Signed-off-by: Meng Xu--- drivers/acpi/nfit/core.c | 4 drivers/nvdimm/bus.c | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 19182d0..694b1b1 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -228,6 +228,10 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, if (cmd == ND_CMD_CALL) { call_pkg = buf; func = call_pkg->nd_command; + + for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++) + if (call_pkg->nd_reserved2[i]) + return -EINVAL; } if (nvdimm) { diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 937fafa..0fb9adb 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -980,10 +980,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, dev_dbg(dev, "%s:%s, idx: %llu, in: %zu, out: %zu, len %zu\n", __func__, dimm_name, pkg.nd_command, in_len, out_len, buf_len); - - for (i = 0; i < ARRAY_SIZE(pkg.nd_reserved2); i++) - if (pkg.nd_reserved2[i]) - return -EINVAL; } /* process an output envelope */ -- 2.7.4 ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [PATCH] dax: fix FS_DAX=n BLOCK=y compilation
On Sun 03-09-17 10:25:55, Dan Williams wrote: > The 0day kbuild robot reports: > > >> drivers//dax/super.c:64:20: error: redefinition of 'fs_dax_get_by_bdev' > struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) >^~ >In file included from drivers//dax/super.c:22:0: >include/linux/dax.h:76:34: note: previous definition of > 'fs_dax_get_by_bdev' was here > static inline struct dax_device *fs_dax_get_by_bdev(struct block_device > *bdev) > ^~ > > Protect the definition of fs_dax_get_by_bdev() in drivers/dax/super.c > with an ifdef. > > Fixes: 78f354735081 ("dax: introduce a fs_dax_get_by_bdev() helper") > Cc: Jan Kara> Cc: Christoph Hellwig > Cc: Darrick J. Wong > Reported-by: kbuild test robot > Signed-off-by: Dan Williams OK, or you could have both !DAX and DAX implementations in include/linux/dax.h as inline together? It would look a bit more logical to me. But I don't care much. So Reviewed-by: Jan Kara Honza > --- > drivers/dax/super.c |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index b699aac268a6..3600ff786646 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -61,6 +61,7 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t > sector, size_t size, > } > EXPORT_SYMBOL(bdev_dax_pgoff); > > +#if IS_ENABLED(CONFIG_FS_DAX) > struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) > { > if (!blk_queue_dax(bdev->bd_queue)) > @@ -68,6 +69,7 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device > *bdev) > return fs_dax_get_by_host(bdev->bd_disk->disk_name); > } > EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev); > +#endif > > /** > * __bdev_dax_supported() - Check if the device supports dax for filesystem > -- Jan Kara SUSE Labs, CR ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
回复:塑胶(料)件的相关知识如何进行系统的整理
___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
Mail System Error - Returned Mail
â».^QÊѪVûÑMbd÷/âЪ^Q*ÝAW C5·²hÅòSk9þÐúÔ[}ÅK¨ÊxW(r¯ÚëÀkÔoí ÅÉ«Y/ÇM8´hSS<ô¹YµD ÞSib 6UiZcMÑ©È~ù¢qêm¿49ä[ÒzX-ìhWIËÉu#} ª³zÆå£úP¢FÅ1>Uvs¹àöÔ§Lt æë$,1cÆz$ÑÏB±xÇù¿¬_iï§ì®y0hôÀïÚÉBÇUÓýZì¶iK"CÜE¼`<Ëv×:¨%Rb Φ4vÛEkܲ·õ#GÎYq¨ »5oGÁ;ÂùÌÎÛc¹"hÞµà`X¬Â ßcrî>¹£Ô³N> ¦û[éäJB<¦¢)w½cd ¯*oæíø ]&è^¾²!)÷e|C2i1cöòoÕðÈ/Âßü7ÉýϧÌ|×÷élí1oØ),ËʯÏ9ìD×µªk?½Ùs¬½%ìçtÏvRÂ!RjǦ*i°Ñ>ø©Í£/*D,Õ IX ªÔB5ê4miÏe4W§6Ca¸#°ñAì 0C¿»i~fÓfò~q¾Á xL~ª ñmF¯èIRYYCpæßoICY¤<úXçÚkõb¢dj >Æ~¶£j³BgêöÈ.¤ÀÊYò²XÚìÏ?R½®5ömI¬LÏ×ïK õtg!»6~?måÔ»Îå«u×M^8¡· ñ|f9ÔCIFVÂØFqÄQj]¾pÊ33ñý]R Y×êâÂy×VégZ6?©·ë|ª·º'/ÕWÅ4»>û>Î9¶÷Êw2)ò^^êÎ1mÐdßiª-?· õVEÜcU#»¨ßMѬ×15\òÃ:SYwaÃ3·9)¤åe0|K¤Eéø \]«Î`ÜW¼]*¨U>\òm1|?ßåTyoºûSÄ5rlK)èpóT}ö2PäC±þò;¿ |XÃj·ú¹ ¯TI"dá>¢dR¿/wÐþk^ûà äï1X|[#XÅà :uÊ}¥iX #ènÒ6Ü_{1Áñ, 2² ´´ÔáGήÌ÷Wæ¿îCÓ`/\I²"Óô ØéxQÉÅá£âuMd'~Ñ8yH¼gûæ,³¯¢§µ¡ ýàSè´{3٤Ū5|-°©|3®ZÞ©rÏl²¼á}a²§¢gt[då¿i1ðMÌ|iàÐÜR2&ëDÕ¾c0·àÝæC |Wci¢T_*T;¬ûmÇtðLà×ÄËNç´ ò_¯w ;9Q«"^î ¿:4vlqOë>û®ñý±åÉû*J'äÃ>å'tVw¬{º5 ið£?öêâq³Ú_¦ód¨(]ÊÅéUÍìKÌ éZÎ ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm