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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 11 Nov 2007 10:26:12 +0800
From:	"eric miao" <eric.y.miao@...il.com>
To:	"Evgeniy Polyakov" <johnpol@....mipt.ru>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, szabolcs.gyurko@....hu
Subject: Re: [PATCH] make ds1wm driver to check ds1wm_platform_data pointer against NULL

On Nov 11, 2007 1:08 AM, Evgeniy Polyakov <johnpol@....mipt.ru> wrote:
> On Fri, Nov 09, 2007 at 05:02:38PM -0800, Andrew Morton (akpm@...ux-foundation.org) wrote:
> > > @@ -351,6 +351,10 @@ static int ds1wm_probe(struct platform_device *pdev)
> > >             goto err0;
> > >     }
> > >     plat = pdev->dev.platform_data;
> > > +   if (!plat) {
> > > +           ret = -ENXIO;
> > > +           goto err0;
> > > +   }
> > >     ds1wm_data->bus_shift = plat->bus_shift;
> > >     ds1wm_data->pdev = pdev;
> > >     ds1wm_data->pdata = plat;
> >
> > I don't understand this change.  Could you please provide some more details
> > regarding what problem it is solving?  How can pdev->dev.platform_data==NULL
> > come about?
>
> If I understood correctly, it is posible to call platform's probe
> callback without previously calling platform_device_add_data() to setup
> platform_data.
>
> But actually I failed to find any user of this platform driver in
> vanilla kernel, so it is hard to say if driver is used properly or not
> by external modules, and thus this change is very likely valid.
>
> --
>         Evgeniy Polyakov
>

Yes, that's exactly what this patch meant to prevent. That no use of
this platform driver in vanilla kernel doesn't mean the check is
unnecessary. Actually, from the code of this driver, the platform_data
is mandatory for the driver to work properly.  Well, if an oops is
on purpose when platform_data == NULL, this is, I agree, completely
unnecessary.

-- 
Cheers
- eric
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ