vnc: Fix password expiration through 'change vnc ""'
PATCH 1/1 vnc: Fix password expiration through 'change vnc ""'
commit 52c18be9e99dabe295321153fda7fce9f76647ac introduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.
This commit refactors the code to eliminate this overloaded semantics invnc_display_password and instead introduces the vnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.
Recently, a set_password command was added that allows both the Spice and VNC password to be set. This command has not shown up in a release yet so the behavior is not yet defined.
This patch proposes that an empty password be treated as an empty password with no special handling. For specifically disabling login, I believe a new command should be introduced instead of overloading semantics.
I'm not sure how Spice handles this but I would recommend that we have Spice and VNC have consistent semantics here for the 0.14.0 release.
console.h +1 -0
@@ -369,6 +369,7 @@ void vnc_display_init(DisplayState *ds);void vnc_display_close (DisplayState *ds);int vnc_display_open (DisplayState *ds,const char *display);int vnc_display_password (DisplayState *ds,const char *password); +int vnc_display_disable_login (DisplayState *ds);int vnc_display_pw_expire (DisplayState *ds,time_t expires);void do_info_vnc_print (Monitor *mon,const QObject *data);void do_info_vnc (Monitor *mon,QObject **ret_data);
monitor.c +9 -0
@@ -1018,6 +1018,13 @@ static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)static int change_vnc_password (const char *password) { +if (!password || !password[0 ]) { +if (vnc_display_disable_login (NULL )) { +qerror_report (QERR_SET_PASSWD_FAILED ); +return -1 ; + } + } +if (vnc_display_password (NULL , password) <0 ) {qerror_report (QERR_SET_PASSWD_FAILED );return -1 ;
@@ -1117,6 +1124,8 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)qerror_report (QERR_INVALID_PARAMETER ,"connected" );return -1 ; } +/* Note that setting an empty password will not disable login through +* this interface. */ rc =vnc_display_password (NULL , password);if (rc !=0 ) {qerror_report (QERR_SET_PASSWD_FAILED );
ui/vnc.c +26 -9
@@ -2484,6 +2484,24 @@ void vnc_display_close(DisplayState *ds)#endif } +int vnc_display_disable_login (DisplayState *ds) +{ +VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + +if (!vs) { +return -1 ; + } + +if (vs->password) { +qemu_free (vs->password); + } + + vs->password =NULL ; + vs->auth =VNC_AUTH_VNC ; + +return 0 ; +} +int vnc_display_password (DisplayState *ds,const char *password) {VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
@@ -2492,19 +2510,18 @@ int vnc_display_password(DisplayState *ds, const char *password)return -1 ; } +if (!password) { +/* This is not the intention of this interface but err on the side +of being safe */ +return vnc_display_disable_login (ds); + } +if (vs->password) {qemu_free (vs->password); vs->password =NULL ; } -if (password && password[0 ]) { -if (!(vs->password =qemu_strdup (password))) -return -1 ; -if (vs->auth ==VNC_AUTH_NONE ) { - vs->auth =VNC_AUTH_VNC ; - } - }else { - vs->auth =VNC_AUTH_NONE ; - } + vs->password =qemu_strdup (password); + vs->auth =VNC_AUTH_VNC ;return 0 ; }
Signature · 1 line
1.7.0.4
Quoted 40 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Recently, a
set_passwordcommand was added that allows both the Spice and VNC password to be set. This command has not shown up in a release yet so the behavior is not yet defined.This patch proposes that an empty password be treated as an empty password with no special handling. For specifically disabling login, I believe a new command should be introduced instead of overloading semantics.
I'm not sure how Spice handles this but I would recommend that we have Spice and VNC have consistent semantics here for the 0.14.0 release.
Reported-by Neil Wilson<[email protected]>Signed-off-by Anthony Liguori<[email protected]>console.h +1
-0@@ -369,6 +369,7 @@ void vnc_display_init(DisplayState *ds);void vnc_display_close (DisplayState *ds);int vnc_display_open (DisplayState *ds,const char *display);int vnc_display_password (DisplayState *ds,const char *password); +int vnc_display_disable_login (DisplayState *ds);int vnc_display_pw_expire (DisplayState *ds,time_t expires);void do_info_vnc_print (Monitor *mon,const QObject *data);void do_info_vnc (Monitor *mon,QObject **ret_data);monitor.c +0
-0
monitor.c static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data) · line 1026
Quoted 9 lines
monitor.c +5
-0@@ -1018,6 +1018,13 @@ static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)static int change_vnc_password (const char *password) { +if (!password || !password[0 ]) { +if (vnc_display_disable_login (NULL )) { +qerror_report (QERR_SET_PASSWD_FAILED ); +return -1 ; + }
Missing return 0;
However, since there is a check in the password handlign in VNC for empty password too, this still ended up working as expected. I've removed that additional check locally and then added the return 0; such that I could confirm the functionality again.
Regards,
Anthony Liguori
Quoted 72 lines
monitor.c +2
-0+ } +if (vnc_display_password (NULL , password)<0 ) {qerror_report (QERR_SET_PASSWD_FAILED );return -1;monitor.c +2
-0@@ -1117,6 +1124,8 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)qerror_report (QERR_INVALID_PARAMETER ,"connected" );return -1 ; } +/* Note that setting an empty password will not disable login through +* this interface. */ rc =vnc_display_password (NULL , password);if (rc !=0 ) {qerror_report (QERR_SET_PASSWD_FAILED );ui/vnc.c +26
-9@@ -2484,6 +2484,24 @@ void vnc_display_close(DisplayState *ds)#endif } +int vnc_display_disable_login (DisplayState *ds) +{ +VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + +if (!vs) { +return -1 ; + } + +if (vs->password) { +qemu_free (vs->password); + } + + vs->password =NULL ; + vs->auth =VNC_AUTH_VNC ; + +return 0 ; +} +int vnc_display_password (DisplayState *ds,const char *password) {VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;@@ -2492,19 +2510,18 @@ int vnc_display_password(DisplayState *ds, const char *password)return -1 ; } +if (!password) { +/* This is not the intention of this interface but err on the side +of being safe */ +return vnc_display_disable_login (ds); + } +if (vs->password) {qemu_free (vs->password); vs->password =NULL ; } -if (password&& password[0 ]) { -if (!(vs->password =qemu_strdup (password))) -return -1 ; -if (vs->auth ==VNC_AUTH_NONE ) { - vs->auth =VNC_AUTH_VNC ; - } - }else { - vs->auth =VNC_AUTH_NONE ; - } + vs->password =qemu_strdup (password); + vs->auth =VNC_AUTH_VNC ;return 0 ; }
Quoted 8 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.
Personally I think this is a little overkill & just reverting the original patch was fine, but from a functional POV your patch produces the same results, so I won't argue.
Quoted 7 lines
Recently, a
set_passwordcommand was added that allows both the Spice and VNC password to be set. This command has not shown up in a release yet so the behavior is not yet defined.This patch proposes that an empty password be treated as an empty password with no special handling. For specifically disabling login, I believe a new command should be introduced instead of overloading semantics.
Agreed, if some mgmt app does need to change this kind of thin on the fly, they'll likely want more than just a toggle between AUTH_NONE/AUTH_VNC too. eg There's AUTH_SASL, which is the only VNC auth scheme with any real security, and the psuedo auth schemes for providing the TLS encryption/certificate support.
Quoted 2 lines
I'm not sure how Spice handles this but I would recommend that we have Spice and VNC have consistent semantics here for the 0.14.0 release.
Sounds like a very good idea.
Quoted 89 lines
Reported-by Neil Wilson <[email protected]>Signed-off-by Anthony Liguori <[email protected]>console.h +1
-0@@ -369,6 +369,7 @@ void vnc_display_init(DisplayState *ds);void vnc_display_close (DisplayState *ds);int vnc_display_open (DisplayState *ds,const char *display);int vnc_display_password (DisplayState *ds,const char *password); +int vnc_display_disable_login (DisplayState *ds);int vnc_display_pw_expire (DisplayState *ds,time_t expires);void do_info_vnc_print (Monitor *mon,const QObject *data);void do_info_vnc (Monitor *mon,QObject **ret_data);monitor.c +9
-0@@ -1018,6 +1018,13 @@ static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)static int change_vnc_password (const char *password) { +if (!password || !password[0 ]) { +if (vnc_display_disable_login (NULL )) { +qerror_report (QERR_SET_PASSWD_FAILED ); +return -1 ; + } + } +if (vnc_display_password (NULL , password) <0 ) {qerror_report (QERR_SET_PASSWD_FAILED );return -1 ;@@ -1117,6 +1124,8 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)qerror_report (QERR_INVALID_PARAMETER ,"connected" );return -1 ; } +/* Note that setting an empty password will not disable login through +* this interface. */ rc =vnc_display_password (NULL , password);if (rc !=0 ) {qerror_report (QERR_SET_PASSWD_FAILED );ui/vnc.c +24
-4@@ -2484,6 +2484,24 @@ void vnc_display_close(DisplayState *ds)#endif } +int vnc_display_disable_login (DisplayState *ds) +{ +VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + +if (!vs) { +return -1 ; + } + +if (vs->password) { +qemu_free (vs->password); + } + + vs->password =NULL ; + vs->auth =VNC_AUTH_VNC ; + +return 0 ; +} +int vnc_display_password (DisplayState *ds,const char *password) {VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;@@ -2492,19 +2510,18 @@ int vnc_display_password(DisplayState *ds, const char *password)return -1 ; } +if (!password) { +/* This is not the intention of this interface but err on the side +of being safe */ +return vnc_display_disable_login (ds); + } +if (vs->password) {qemu_free (vs->password); vs->password =NULL ; } -if (password && password[0 ]) { -if (!(vs->password =qemu_strdup (password))) -return -1 ; -if (vs->auth ==VNC_AUTH_NONE ) {
ui/vnc.c int vnc_display_password(DisplayState *ds, const char *password) · line 2527
Quoted 10 lines
ui/vnc.c +2
-5- vs->auth =VNC_AUTH_VNC ; - } - }else { - vs->auth =VNC_AUTH_NONE ; - } + vs->password =qemu_strdup (password); + vs->auth =VNC_AUTH_VNC ;return 0 ; }
Looks good, assuming the addition of the missing 'return 0' you already mentioned
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Quoted 6 lines · Daniel P. Berrange
Quoted 4 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.
Quoted 9 lines
Quoted 5 lines
This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Personally I think this is a little overkill& just reverting the original patch was fine, but from a functional POV your patch produces the same results, so I won't argue.
For 0.15, I'd like to introduce a new set of commands such that we don't multiplex the change command anymore. This refactoring lays the ground work for that.
For instance, if you created a block device with the name 'vnc', you'd get very unexpected results! Multiplexing based on special values on top of existing commands is pretty evil.
Quoted 118 lines
Quoted 8 lines
Recently, a
set_passwordcommand was added that allows both the Spice and VNC password to be set. This command has not shown up in a release yet so the behavior is not yet defined.This patch proposes that an empty password be treated as an empty password with no special handling. For specifically disabling login, I believe a new command should be introduced instead of overloading semantics.
Agreed, if some mgmt app does need to change this kind of thin on the fly, they'll likely want more than just a toggle between AUTH_NONE/AUTH_VNC too. eg There's
AUTH_SASL, which is the only VNC auth scheme with any real security, and the psuedo auth schemes for providing the TLS encryption/certificate support.Quoted 3 lines
I'm not sure how Spice handles this but I would recommend that we have Spice and VNC have consistent semantics here for the 0.14.0 release.
Sounds like a very good idea.
Quoted 97 lines
Reported-by Neil Wilson<[email protected]>Signed-off-by Anthony Liguori<[email protected]>console.h +1
-0@@ -369,6 +369,7 @@ void vnc_display_init(DisplayState *ds);void vnc_display_close (DisplayState *ds);int vnc_display_open (DisplayState *ds,const char *display);int vnc_display_password (DisplayState *ds,const char *password); +int vnc_display_disable_login (DisplayState *ds);int vnc_display_pw_expire (DisplayState *ds,time_t expires);void do_info_vnc_print (Monitor *mon,const QObject *data);void do_info_vnc (Monitor *mon,QObject **ret_data);monitor.c +9
-0@@ -1018,6 +1018,13 @@ static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)static int change_vnc_password (const char *password) { +if (!password || !password[0 ]) { +if (vnc_display_disable_login (NULL )) { +qerror_report (QERR_SET_PASSWD_FAILED ); +return -1 ; + } + } +if (vnc_display_password (NULL , password)<0 ) {qerror_report (QERR_SET_PASSWD_FAILED );return -1 ;@@ -1117,6 +1124,8 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)qerror_report (QERR_INVALID_PARAMETER ,"connected" );return -1 ; } +/* Note that setting an empty password will not disable login through +* this interface. */ rc =vnc_display_password (NULL , password);if (rc !=0 ) {qerror_report (QERR_SET_PASSWD_FAILED );ui/vnc.c +26
-9@@ -2484,6 +2484,24 @@ void vnc_display_close(DisplayState *ds)#endif } +int vnc_display_disable_login (DisplayState *ds) +{ +VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + +if (!vs) { +return -1 ; + } + +if (vs->password) { +qemu_free (vs->password); + } + + vs->password =NULL ; + vs->auth =VNC_AUTH_VNC ; + +return 0 ; +} +int vnc_display_password (DisplayState *ds,const char *password) {VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;@@ -2492,19 +2510,18 @@ int vnc_display_password(DisplayState *ds, const char *password)return -1 ; } +if (!password) { +/* This is not the intention of this interface but err on the side +of being safe */ +return vnc_display_disable_login (ds); + } +if (vs->password) {qemu_free (vs->password); vs->password =NULL ; } -if (password&& password[0 ]) { -if (!(vs->password =qemu_strdup (password))) -return -1 ; -if (vs->auth ==VNC_AUTH_NONE ) { - vs->auth =VNC_AUTH_VNC ; - } - }else { - vs->auth =VNC_AUTH_NONE ; - } + vs->password =qemu_strdup (password); + vs->auth =VNC_AUTH_VNC ;
Quoted 6 lines
ui/vnc.c int vnc_display_password(DisplayState *ds, const char *password) · line 2527
Quoted 3 lines
ui/vnc.c +0
-0return 0 ; }Looks good, assuming the addition of the missing 'return 0' you already mentioned
Yup. Thanks.
Regards,
Anthony Liguori
Quoted 2 lines
Daniel
Quoted 14 lines · Anthony Liguori
Quoted 5 lines · Daniel P. Berrange
Quoted 4 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.Quoted 7 lines
Quoted 4 lines
This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Personally I think this is a little overkill& just reverting the original patch was fine, but from a functional POV your patch produces the same results, so I won't argue.
Quoted 7 lines
For 0.15, I'd like to introduce a new set of commands such that we
don't multiplex the change command anymore. This refactoring lays
the ground work for that.For instance, if you created a block device with the name 'vnc', you'd get very unexpected results! Multiplexing based on special values on top of existing commands is pretty evil.
Doesn't Gerd's 'set_password' command already replace the functionality of the 'change vnc' command. So we should likely declare 'change vnc' as deprecated in 0.14 and remove it in 0.16
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Quoted 23 lines · Daniel P. Berrange
Quoted 21 lines · Anthony Liguori
Quoted 6 lines · Daniel P. Berrange
Quoted 4 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.Quoted 9 lines
Quoted 5 lines
This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Personally I think this is a little overkill& just reverting the
original patch was fine, but from a functional POV your patch produces the same results, so I won't argue.For 0.15, I'd like to introduce a new set of commands such that we
don't multiplex the change command anymore. This refactoring lays
the ground work for that.
Quoted 8 lines
Quoted 4 lines
For instance, if you created a block device with the name 'vnc', you'd get very unexpected results! Multiplexing based on special values on top of existing commands is pretty evil.
Doesn't Gerd's '
set_password' command already replace the functionality of the 'change vnc' command. So we should likely declare 'change vnc' as deprecated in 0.14 and remove it in 0.16
Yup. But it doesn't let you disable login. Since that was a feature of 'change vnc', I think we need to provide a proper interface to do this.
Likewise, we need a new interface for changing the block device. The way password setting is handled is fubar right now.
I've got some new commands documented in a git tree if you're interested.
http://repo.or.cz/w/qemu/aliguori.git/blob/refs/heads/glib:/qmp-schema.json
Regards,
Anthony Liguori
Quoted 3 lines
Regards,
Daniel
Quoted 33 lines · Anthony Liguori
Quoted 23 lines · Daniel P. Berrange
Quoted 21 lines · Anthony Liguori
Quoted 6 lines · Daniel P. Berrange
Quoted 4 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.Quoted 9 lines
Quoted 5 lines
This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Personally I think this is a little overkill& just reverting the
original patch was fine, but from a functional POV your patch produces the same results, so I won't argue.For 0.15, I'd like to introduce a new set of commands such that we
don't multiplex the change command anymore. This refactoring lays
the ground work for that.Quoted 8 lines
Quoted 4 lines
For instance, if you created a block device with the name 'vnc', you'd get very unexpected results! Multiplexing based on special values on top of existing commands is pretty evil.
Doesn't Gerd's '
set_password' command already replace the functionality of the 'change vnc' command. So we should likely declare 'change vnc' as deprecated in 0.14 and remove it in 0.16
Quoted 6 lines
Yup. But it doesn't let you disable login. Since that was a feature of 'change vnc', I think we need to provide a proper interface to do this.
Likewise, we need a new interface for changing the block device. The way password setting is handled is fubar right now.
Not just that.
Quoted 3 lines
I've got some new commands documented in a git tree if you're interested.
http://repo.or.cz/w/qemu/aliguori.git/blob/refs/heads/glib:/qmp-schema.json
The command to insert media into an empty block backend needs to support same range of media options as the command to create a block backend with media (that command is currently caught within drive_add, struggling to get out).
My efforts to provide exactly that got bogged down last year by protracted design discussions on the finer points of its QMP interface, and the need to clean up and fix N+1 things before I can even start attacking the goal problem. Fortunately, much of the preliminary work got in. Unfortunately, I haven't been able to work on the rest, lately :(
Media change is just a convenience command fusing eject and insert. For even more convenience, we can make it inherit option defaults from the media being replaced.
Quoted 8 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.
Hmm, now about simply never ever changing vs->auth?
cheers,
Gerd
Quoted 11 lines · Gerd Hoffmann
Quoted 8 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing string.Hmm, now about simply never ever changing
vs->auth?
If auth is none and you do a vnc change password "" then if we don't set vs->auth to vnc, it won't have the desired effect. I really dislike the semantics of this command but that was a past mistake.
Regards,
Anthony Liguori
Quoted 4 lines
cheers,
Gerd
Quoted 15 lines · Anthony Liguori
Quoted 14 lines · Gerd Hoffmann
Quoted 12 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the
change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing
string.
Quoted 5 lines
Quoted 1 line
Hmm, now about simply never ever changing
vs->auth?If auth is none and you do a vnc change password "" then if we don't set
vs->authto vnc, it won't have the desired effect. I really dislike the semantics of this command but that was a past mistake.
Actually blindly setting 'vs->auth' to 'vnc' is also a security flaw. If using the VeNCrypt security method, then 'vs->auth' will be VENCRYPT and the 'vs->subauth' will possibly indicate the 'VNC' sub-auth scheme. So we really do want the change password command to leave 'vs->auth' alone completely - just change the password string, with no side effects on auth methods. If an app intends to use the change password command it will have already launched QEMU with neccessary -vnc flags to set the desired vs->auth and vs->subauth methods.
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Quoted 19 lines · Daniel P. Berrange
Quoted 17 lines · Anthony Liguori
Quoted 15 lines · Gerd Hoffmann
Quoted 13 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the
change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing
string.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Hmm, now about simply never ever changing
vs->auth?If auth is none and you do a vnc change password "" then if we don't set
vs->authto vnc, it won't have the desired effect. I really dislike the semantics of this command but that was a past mistake.Actually blindly setting '
vs->auth' to 'vnc' is also a security flaw.
But this is the semantics of the command. I agree it's stupid but a security flaw is a regression and this is not a regression.
This is why the set-password command no longer does any of this nonsense.
Quoted 8 lines
If using the VeNCrypt security method, then '
vs->auth' will be VENCRYPT and the 'vs->subauth' will possibly indicate the 'VNC' sub-auth scheme. So we really do want the change password command to leave 'vs->auth' alone completely - just change the password string, with no side effects on auth methods. If an app intends to use the change password command it will have already launched QEMU with neccessary -vnc flags to set the desiredvs->authandvs->subauthmethods.
I think I see how this could work but I'm not sure it's worth doing. I'd rather just leave the (bad) semantics of this command alone and deprecate the interface.
Regards,
Anthony Liguori
Quoted 3 lines
Regards,
Daniel
Quoted 35 lines · Anthony Liguori
Quoted 15 lines · Daniel P. Berrange
Quoted 14 lines · Anthony Liguori
Quoted 13 lines · Gerd Hoffmann
Quoted 12 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the
change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing
string.Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Hmm, now about simply never ever changing
vs->auth?If auth is none and you do a vnc change password "" then if we don't set
vs->authto vnc, it won't have the desired effect. I really dislike the semantics of this command but that was a past mistake.Actually blindly setting '
vs->auth' to 'vnc' is also a security flaw.But this is the semantics of the command. I agree it's stupid but a security flaw is a regression and this is not a regression.
This is why the set-password command no longer does any of this nonsense.
Quoted 7 lines
If using the VeNCrypt security method, then '
vs->auth' will be VENCRYPT and the 'vs->subauth' will possibly indicate the 'VNC' sub-auth scheme. So we really do want the change password command to leave 'vs->auth' alone completely - just change the password string, with no side effects on auth methods. If an app intends to use the change password command it will have already launched QEMU with neccessary -vnc flags to set the desiredvs->authandvs->subauthmethods.
Quoted 3 lines
I think I see how this could work but I'm not sure it's worth doing. I'd rather just leave the (bad) semantics of this command alone and deprecate the interface.
If you make it blindly set 'vs->auth = VNC' then you haven't fully
fixed the security flawed, because you will be downgrading from 'vencrypt+vnc' auth to just 'vnc' which loose all your data encryption capabilities. Just reverting the previous commit 52c18be9e99dabe295321153fda7fce9f76647ac fully addresses the problems leaving the command side-effect free
as it was originally designed & implemented.
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Quoted 15 lines · Anthony Liguori
Quoted 14 lines · Gerd Hoffmann
Quoted 12 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the
change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing
string.
Quoted 4 lines
Quoted 1 line
Hmm, now about simply never ever changing
vs->auth?If auth is none and you do a vnc change password "" then if we don't set
vs->authto vnc, it won't have the desired effect.
If you want a password-protected vnc session you should better explicitly say so using '-vnc :0,password', otherwise you'll have a window (between qemu start and setting the password) where vnc clients can connect without a password.
Going from "none" to "vnc" automagically when setting a password encourages this insecure way to enable password protection. IMHO we should stop doing this. There are backward compatibility issues though as qemu did this for quite some time ...
Going from "vnc" to "none" automagically when setting a empty password is a no-go from a security point of view, especially as older qemu versions did *not* do that.
I don't think we'll need a monitor command to switch authentication methods on the fly. YMMV.
cheers,
Gerd
Quoted 16 lines · Gerd Hoffmann
Quoted 15 lines · Anthony Liguori
Quoted 14 lines · Gerd Hoffmann
Quoted 12 lines · Anthony Liguori
commit
52c18be9e99dabe295321153fda7fce9f76647acintroduced a regression in the
change vnc password command that changed the behavior of setting the VNC password to an empty string from disabling login to disabling authentication.This commit refactors the code to eliminate this overloaded semantics in
vnc_display_passwordand instead introduces thevnc_display_disable_login. The
monitor implementation then determines the behavior of an empty or missing
string.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Hmm, now about simply never ever changing
vs->auth?If auth is none and you do a vnc change password "" then if we don't set
vs->authto vnc, it won't have the desired effect.If you want a password-protected vnc session you should better explicitly say so using '-vnc :0,password', otherwise you'll have a window (between qemu start and setting the password) where vnc clients can connect without a password.
Going from "none" to "vnc" automagically when setting a password encourages this insecure way to enable password protection. IMHO we should stop doing this. There are backward compatibility issues though as qemu did this for quite some time ...
Yeah, change vnc is deprecated, set-password has sane semantics.
Quoted 1 line
Going from "vnc" to "none" automagically when setting a empty password is a no-go from a security point of view, especially as older qemu versions did *not* do that. ]
Yup, this was the reason for the CVE.
Quoted 1 line
I don't think we'll need a monitor command to switch authentication methods on the fly. YMMV.
Actually, I do, but that's far off on my radar screen.
One thing we're noticing is that QEMU is not terribly forgiving in a hosting environment. If you make a mistake configuring something (like use the wrong auth type), you're only recourse is restarting the guest with the new options. Restarting a guest of a paying customer == unhappy customer.
The more we can change without restarting a guest the better IMHO.
Regards,
Anthony Liguori
Quoted 3 lines
cheers,
Gerd