Re: [PATCH wayland] wayland-server: Properly handle EAGAIN from wl_connection_read()

2018-04-20 Thread Derek Foreman
On 2018-04-19 09:18 AM, Derek Foreman wrote:
> On 2018-04-19 09:01 AM, Derek Foreman wrote:
>> From: Dipen Somani 
>>
>> commit 3cddb3c692acd3536a7cc8542a29f0cc3c0ac3d6 casted len to an
>> unsigned value to compare to sizeof results.  However,
>> wl_connection_read() can fail, setting errno to EAGAIN and returning
>> a value of -1.
>>
>> When cast to an unsigned type this leads to a loop condition of true
>> when it should be false.
>>
>> Signed-off-by: Dipen Somani 
>> Signed-off-by: Derek Foreman 
> 
> I forgot to add:
> Reviewed-by: Derek Foreman 

And have now landed it.

Thanks,
Derek

>> ---
>>  src/wayland-server.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/wayland-server.c b/src/wayland-server.c
>> index eb1e500..eab2ee4 100644
>> --- a/src/wayland-server.c
>> +++ b/src/wayland-server.c
>> @@ -353,7 +353,7 @@ wl_client_connection_data(int fd, uint32_t mask, void 
>> *data)
>>  }
>>  }
>>  
>> -while ((size_t) len >= sizeof p) {
>> +while (len >= 0 && (size_t) len >= sizeof p) {
>>  wl_connection_copy(connection, p, sizeof p);
>>  opcode = p[1] & 0x;
>>  size = p[1] >> 16;
>>
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH v2 0/3] Deal with destroy signal use after free issues

2018-04-20 Thread Derek Foreman
I've pushed this series now.

Thanks,
Derek

On 2018-04-16 03:00 PM, Derek Foreman wrote:
> Now that the release is out, I'd like to dig back into this mess.
> This is a round up of some patches that were on list shortly before
> the release to deal with a problem where many existing libwayland
> users don't delete their destroy signal listeners before freeing
> them.
> 
> These leads to a bit of a mess (as Markus' test illustrates) if there
> are multiple destroy listeners.
> 
> I've included:
> My test patch to ensure the existing behaviour continues to work
> (users like weston and enlightenment can free during destroy
> listener)
> 
> The special case destroy emit path for wl_priv_signal - this is
> an attempt to "fix" the problem, by making the destroy signal
> emit operate without ever touching potentially free()d elements
> again.
> 
> Markus' test that would fail without patch 2/3, as it catches the
> free() without removal case we've all come to know any love.
> 
> Derek Foreman (2):
>   tests: Test for use after free in resource destruction signals
>changes since first appearance: none
> 
>   server: Add special case destroy signal emitter
>changes since first appearance:  stop trying to maintain a list head
> 
> Markus Ongyerth (1):
>   tests: Add free-without-remove test
>changes since first appearance: I moved it into an existing file
> 
>  src/wayland-private.h  |  3 +++
>  src/wayland-server.c   | 46 +++---
>  tests/resources-test.c | 39 +++
>  3 files changed, 85 insertions(+), 3 deletions(-)
> 

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 11/25] tests: add test_seat_release() for symmetry

2018-04-20 Thread Pekka Paalanen
On Thu, 5 Apr 2018 16:26:58 +1000
Peter Hutterer  wrote:

> On Fri, Mar 23, 2018 at 02:00:51PM +0200, Pekka Paalanen wrote:
> > From: Pekka Paalanen 
> > 
> > Add test_seat_release() as the counterpart of test_seat_init() instead
> > of open-coding it. This helps adding more code to test_seat_release()
> > later.
> > 
> > Signed-off-by: Pekka Paalanen   
> 
> Patches 01 to 11 are Reviewed-by: Peter Hutterer 
> still working on the rest

Hi Peter,

I fixed the WESTON_LIBINPUT_LOG_PRIORITY as you suggested, and pushed
patches 1-11:
   6fae2be9..f39249ad  master -> master


Thanks,
pq


pgpyiZKUL7pqH.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput] evdev: disable ABS_MT_TOOL_PALM on the Lenovo X1 Carbon 6th gen

2018-04-20 Thread Benjamin Tissoires
On Thu, Apr 19, 2018 at 5:19 AM, Peter Hutterer
 wrote:
> This device randomly decides that a touch is now a palm, based on
> the moon phase, the user's starsign and possibly what the dog had for
> breakfast. Since libinput assumes that a touchpad that labels a touch as palm
> has reasons to do so, let's unassume this for this device by disabling that
> axis altogether and relying on the touch pressure only.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1565692
>
> Signed-off-by: Peter Hutterer 
> ---

LGTM:
Reviewed-by: Benjamin Tissoires 

Cheers,
Benjamin

>  src/evdev.c| 8 
>  src/evdev.h| 1 +
>  udev/90-libinput-model-quirks.hwdb | 4 
>  3 files changed, 13 insertions(+)
>
> diff --git a/src/evdev.c b/src/evdev.c
> index 2a4682c7..95351082 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1285,6 +1285,7 @@ evdev_read_model_flags(struct evdev_device *device)
> MODEL(MS_NANO_TRANSCEIVER),
> MODEL(TABLET_NO_TILT),
> MODEL(TABLET_MODE_NO_SUSPEND),
> +   MODEL(LENOVO_CARBON_X1_6TH),
>  #undef MODEL
> { "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
> { NULL, EVDEV_MODEL_DEFAULT },
> @@ -1908,6 +1909,13 @@ evdev_pre_configure_model_quirks(struct evdev_device 
> *device)
> libevdev_disable_event_code(device->evdev, EV_ABS, 
> ABS_TILT_X);
> libevdev_disable_event_code(device->evdev, EV_ABS, 
> ABS_TILT_Y);
> }
> +
> +   /* Lenovo Carbon X1 6th gen sends bogus ABS_MT_TOOL_TYPE events for
> +* MT_TOOL_PALM */
> +   if (device->model_flags & EVDEV_MODEL_LENOVO_CARBON_X1_6TH)
> +   libevdev_disable_event_code(device->evdev,
> +   EV_ABS,
> +   ABS_MT_TOOL_TYPE);
>  }
>
>  static void
> diff --git a/src/evdev.h b/src/evdev.h
> index 5495e94d..d1290610 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -113,6 +113,7 @@ enum evdev_device_model {
> EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
> EVDEV_MODEL_LOGITECH_K400 = (1 << 11),
> EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12),
> +   EVDEV_MODEL_LENOVO_CARBON_X1_6TH = (1 << 13),
> EVDEV_MODEL_CYBORG_RAT = (1 << 14),
> EVDEV_MODEL_HP_STREAM11_TOUCHPAD = (1 << 16),
> EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
> diff --git a/udev/90-libinput-model-quirks.hwdb 
> b/udev/90-libinput-model-quirks.hwdb
> index 33676d4e..9dcb38e3 100644
> --- a/udev/90-libinput-model-quirks.hwdb
> +++ b/udev/90-libinput-model-quirks.hwdb
> @@ -245,6 +245,10 @@ libinput:name:*ALPS 
> TrackPoint*:svnLENOVO:*:pvrThinkPadX280:*
>  libinput:name:AT Translated Set 2 
> keyboard:dmi:*svnLENOVO:*pvrThinkPadX1Yoga1st:*
>   LIBINPUT_MODEL_TABLET_MODE_NO_SUSPEND=1
>
> +# Lenovo Carbon X1 6th gen (RMI4 only, PS/2 is broken on this device)
> +libinput:name:Synaptics TM3288-010:dmi:*svnLenovo:*pvrThinkPadX1Carbon6th:*
> + LIBINPUT_MODEL_LENOVO_CARBON_X1_6TH=1
> +
>  ##
>  # Logitech
>  ##
> --
> 2.14.3
>
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel