Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1289946

Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

From Brian Norris <computersforpeace@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()
Date 2015-12-11 23:20 +0100
Message-ID <qEEcF-1XA-5@gated-at.bofh.it> (permalink)
References <qE4sx-3sW-3@gated-at.bofh.it> <qE4sB-3sW-89@gated-at.bofh.it> <qEk4i-5fE-5@gated-at.bofh.it> <qEE30-1U8-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Boris,

On Fri, Dec 11, 2015 at 11:03:05PM +0100, Boris Brezillon wrote:
> On Thu, 10 Dec 2015 16:40:08 -0800
> Brian Norris <computersforpeace@gmail.com> wrote:
> > On Thu, Dec 10, 2015 at 08:59:45AM +0100, Boris Brezillon wrote:
> > > Unregister the NAND device from the NAND subsystem when removing a denali
> > > NAND controller, otherwise the MTD attached to the NAND device is still
> > > exposed by the MTD layer, and accesses to this device will likely crash
> > > the system.
> > > 
> > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > Cc: <stable@vger.kernel.org> #3.8+
> > 
> > Does this follow these rules, from
> > Documentation/stable_kernel_rules.txt?
> > 
> >  - It must be obviously correct and tested.
> > 
> >  - It must fix a real bug that bothers people (not a, "This could be a
> >    problem..." type thing).
> 
> Sorry to bring the "stable or not stable (that is the question :-))"
> debate back, but after thinking a bit more about the implications of
> this missing nand_release() call, I think it is worth backporting the
> fix to all stable kernels.
> The reason is, it can potentially introduce a security hole, because if
> the mtd device is not unregister but the underlying mtd object is freed
> and the kernel reuses the same memory region for a different object,
> the MTD layer will possibly call one of the mtd->_method() function,
> and this field might point to another completely different function.
> 
> You'll say that denali devices are probably never removed and this is
> the reason why people have never seen this problem before, which would
> be a good reason to not bother backporting the patch.
> But, given that the driver can be compiled as a module (the user can
> possibly load/unload it, which will in turn create/destroy the
> NAND/MTD device), and that the denali controller can be exposed through
> a PCI bus (which, AFAIK is hotpluggable), I really think this fix
> should be sent to stable.

That's all well and good, but still nobody has told me they've tested
this.

I've pushed your v5 (+ comments, + ack) to l2-mtd.git. If it gets
testing and this request is made again at that point, we can easily send
it to stable after it hits Linus' tree. See option 2 in
Documentation/stable_kernel_rules.txt. You can even send the email
yourself, just CC me and anyone else relevant. I'll ack it if it's been
tested.

Regards,
Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-10 09:10 +0100
  Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Brian Norris <computersforpeace@gmail.com> - 2015-12-11 01:50 +0100
    Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 15:00 +0100
      Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-11 15:50 +0100
        Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 16:20 +0100
    Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 23:10 +0100
      Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Brian Norris <computersforpeace@gmail.com> - 2015-12-11 23:20 +0100
  [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 15:10 +0100
    Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 16:20 +0100
      Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dinh Nguyen <dinh.linux@gmail.com> - 2015-12-11 18:00 +0100
        Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 18:10 +0100
          Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dinh Nguyen <dinh.linux@gmail.com> - 2015-12-11 18:30 +0100

csiph-web