usb-device/
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.o
those should not be hard to come by.
Thanks for your answers. I'm going to take a look at TODO entries in
staging, and at sensor drivers then. You might see me come back later
with questions. :)
Happy hacking !
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4
test it because I don't have test
devices.
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
enter in an inconsistent state.
Add a mutex making sure that the PI433_IOC_WR_TX_CFG case will never
be run by several threads concurrently.
Signed-off-by: Hugo Lefeuvre
---
drivers/staging/pi433/pi433_if.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/staging
_data, which
> wraps struct pi433_instance and its mutex.
>
> Make filp->private_data point to a struct pi433_data, allowing to
> acquire the lock before accessing the struct pi433_instance.
>
> Signed-off-by: Hugo Lefeuvre
> ---
> Changes in v2:
> - Use mutex
don't even need to introduce a new lock, using
device->tx_fifo_lock should be fine. I'll update the patch.
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Descript
en to the fifo by
pi433_write.
What kind of checks do you want to perform exactly ?
But, right, I prefer the idea of the temporary buffer too, and seeing the
rest of kernel code it seems to be the usual way to go.
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096
_CFG case in pi433_ioctl.
Also, do not copy data directly from user space to instance->tx_cfg.
Instead use a temporary buffer allowing future checks for correctness
of copied data.
Signed-off-by: Hugo Lefeuvre
---
Changes in v2:
- Use device->tx_fifo_lock instead of introducing a new lock in
fixed in v4. Sorry for the noise.
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kerne
_CFG case in pi433_ioctl.
Also, do not copy data directly from user space to instance->tx_cfg.
Instead use a temporary buffer allowing future checks for correctness
of copied data and simpler code.
Signed-off-by: Hugo Lefeuvre
---
Changes in v4:
- Fix incorrect buffer name in memcpy.
---
drivers/s
if (copy_from_user(_cfg_buffer, argp,
> > + sizeof(struct pi433_tx_cfg))) {
>
> Sorry for the duplicate review, but it got sent to both my inboxes... :P
Thanks for your review ! Patch updated.
Please tell me if you don't to be CC-ed anymore. :)
regard
_CFG case in pi433_ioctl.
Also, do not copy data directly from user space to instance->tx_cfg.
Instead use a temporary buffer allowing future checks for correctness
of copied data and simpler code.
Signed-off-by: Hugo Lefeuvre
---
Changes in v3:
- Use tx_cfg for the name of temporary buffer (sho
on this particular issue ? (apart from the bug tracker, which
doesn't seem to be very active when it comes to the staging subtree)
Thanks !
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP
appen.
I'll submit a patch. Thanks !
Cheers,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewb
ecuting between lines 879 and
880, we might perform a NULL pointer dereference, right ?
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
uite rare.
Then I will simply submit my patch and let the maintainer check for
conflicts.
Thanks for your answer.
Cheers,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Descript
t while release is being called, the ioctl call from T1 may still
be running, right ?
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
___
Kernelnew
340] [<8010b810>] (do_work_pending) from [<80108094>]
> (slow_work_pending+0xc/0x20)
Interesting. I don't know what's happening here, but the idea that
release() would be delayed until all operations returned (as nice
as it sounds) seems pretty odd to me.
I'll not have time to experiment on
passed FD but instead create duplicates to make sure the open
file description won't be freed during their execution, right ?
Cheers,
hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Descri
lso affect pi433_write and pi433_read.
The newly introduced semaphore makes sure that filp->private_data
will not be freed by pi433_release (writer) as long as pi433_write,
pi433_read or pi433_ioctl (readers) are still executing.
Signed-off-by: Hugo Lefeuvre
---
drivers/staging/pi433/pi433_if.
dn't notice it. Thanks !
Otherwise, do you think the usage of rw semaphore is appropriate in this
case ?
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
___
Kernelnewbies mai
ilp->private_data point to a struct pi433_data, allowing to
acquire the lock before accessing the struct pi433_instance.
Signed-off-by: Hugo Lefeuvre
---
Changes in v2:
- Use mutex instead of rw semaphore.
- Introduce struct pi433_data in order to allow functions t
wrapper struct pi433_data which would contain
pointers to the pi433_instance and its mutex. I couldn't find any
similar situation in the kernel, so I'm not sure it's the right way to
go though.
Thanks !
Regards,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0
atch later.
Thanks !
Cheers,
Hugo
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
signature.asc
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies
safe :)
I'll take a closer look at the TODO and come back later with a patch. If
there's nothing to do I'll remove it, otherwise I'll fix it.
Cheers,
Hugo
[0] https://elixir.bootlin.com/linux/latest/source/fs/ioctl.c#L692
--
Hugo Lefeuvre (hle)|www.owl.eu.com
4096/ 9C4F
25 matches
Mail list logo