All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] Linux user for 6.0 patches
@ 2021-03-30 14:38 Laurent Vivier
  2021-03-30 14:38 ` [PULL 1/1] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-03-30 14:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

The following changes since commit ec2e6e016d24bd429792d08cf607e4c5350dcdaa:

  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
request' into staging (2021-03-28 19:49:57 +0100)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/linux-user-for-6.0-pull-request

for you to fetch changes up to 13e340c886679fb17df02a35e7d82cb8beb6e9f4:

  linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 (202=
1-03-29 21:56:18 +0200)

----------------------------------------------------------------
linux-user Pull request 20210330

Fix NETLINK_LIST_MEMBERSHIPS with NULL/invalid pointer and 0 length

----------------------------------------------------------------

Fr=C3=A9d=C3=A9ric Fortier (1):
  linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0

 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--=20
2.30.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL 1/1] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0
  2021-03-30 14:38 [PULL 0/1] Linux user for 6.0 patches Laurent Vivier
@ 2021-03-30 14:38 ` Laurent Vivier
  2021-03-30 17:20 ` [PULL 0/1] Linux user for 6.0 patches Peter Maydell
  2021-03-31 12:13 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-03-30 14:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Frédéric Fortier, Laurent Vivier

From: Frédéric Fortier <frf@ghgsat.com>

getsockopt(fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, *optval, *optlen)
syscall allows optval to be NULL/invalid if optlen points to a size of
zero. This allows userspace to query the length of the array they should
use to get the full membership list before allocating memory for said
list, then re-calling getsockopt with proper optval/optlen arguments.

Notable users of this pattern include systemd-networkd, which in the
(albeit old) version 237 tested, cannot start without this fix.

Signed-off-by: Frédéric Fortier <frf@ghgsat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210328180135.88449-1-frf@ghgsat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 294779c86f4d..95d79ddc437a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3025,7 +3025,7 @@ get_timeout:
                 return -TARGET_EINVAL;
             }
             results = lock_user(VERIFY_WRITE, optval_addr, len, 1);
-            if (!results) {
+            if (!results && len > 0) {
                 return -TARGET_EFAULT;
             }
             lv = len;
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PULL 0/1] Linux user for 6.0 patches
  2021-03-30 14:38 [PULL 0/1] Linux user for 6.0 patches Laurent Vivier
  2021-03-30 14:38 ` [PULL 1/1] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 Laurent Vivier
@ 2021-03-30 17:20 ` Peter Maydell
  2021-03-31 12:13 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2021-03-30 17:20 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Developers

On Tue, 30 Mar 2021 at 15:49, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit ec2e6e016d24bd429792d08cf607e4c5350dcdaa:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
> request' into staging (2021-03-28 19:49:57 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-6.0-pull-request
>
> for you to fetch changes up to 13e340c886679fb17df02a35e7d82cb8beb6e9f4:
>
>   linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 (202=
> 1-03-29 21:56:18 +0200)
>
> ----------------------------------------------------------------
> linux-user Pull request 20210330
>
> Fix NETLINK_LIST_MEMBERSHIPS with NULL/invalid pointer and 0 length
>
> ----------------------------------------------------------------
>
> Fr=C3=A9d=C3=A9ric Fortier (1):
>   linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0
>
>  linux-user/syscall.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This didn't quite make it in time for rc1, but it's only one patch;
it's still on my to-process queue and I'll apply it tomorrow.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PULL 0/1] Linux user for 6.0 patches
  2021-03-30 14:38 [PULL 0/1] Linux user for 6.0 patches Laurent Vivier
  2021-03-30 14:38 ` [PULL 1/1] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 Laurent Vivier
  2021-03-30 17:20 ` [PULL 0/1] Linux user for 6.0 patches Peter Maydell
@ 2021-03-31 12:13 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2021-03-31 12:13 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Developers

On Tue, 30 Mar 2021 at 15:49, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit ec2e6e016d24bd429792d08cf607e4c5350dcdaa:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
> request' into staging (2021-03-28 19:49:57 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-6.0-pull-request
>
> for you to fetch changes up to 13e340c886679fb17df02a35e7d82cb8beb6e9f4:
>
>   linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 (202=
> 1-03-29 21:56:18 +0200)
>
> ----------------------------------------------------------------
> linux-user Pull request 20210330
>
> Fix NETLINK_LIST_MEMBERSHIPS with NULL/invalid pointer and 0 length
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-31 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 14:38 [PULL 0/1] Linux user for 6.0 patches Laurent Vivier
2021-03-30 14:38 ` [PULL 1/1] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0 Laurent Vivier
2021-03-30 17:20 ` [PULL 0/1] Linux user for 6.0 patches Peter Maydell
2021-03-31 12:13 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.