* [PATCH] disable lomount and miniterm by default
@ 2008-01-16 17:01 Ian Jackson
2008-01-16 17:11 ` Daniel P. Berrange
0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2008-01-16 17:01 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 1212 bytes --]
lomount is a tool which reads and parses a partition table in a disk
image block device and then uses mount -o ...offset=... to mount it.
This is not an ideal approach. For example, if the intended
filesystem has corrupted metadata the kernel's filesystem driver may
start to write outside of the intended region. This might even be
exploitable in some perverse circumstances.
Nowadays people wanting to do this should use kpartx, which uses
devmapper to create appropriate range mappings. So lomount should be
disabled.
miniterm may well be useful but it is a clone-and-hack of an upstream
project and is currently built but not installed by default, partly
because it doesn't make sense to install on the dom0 which it might be
trying to debug.
It is probably useful to retain these two programs in the source tree
but IMO they should no longer be built by default.
The attached patch does these things:
* CONFIG_LOMOUNT and CONFIG_MINITERM in Config.mk
can enable and disable these programs
* They are disabled by default
* If CONFIG_MINITERM=y it is still built but not installed.
make -C tools/misc/miniterm install will install it.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
[-- Attachment #2: lomount and miniterm are a bit obsolete here at least --]
[-- Type: text/plain, Size: 2448 bytes --]
diff -r 2491691e3e69 Config.mk
--- a/Config.mk Sat Dec 29 17:57:47 2007 +0000
+++ b/Config.mk Wed Jan 16 16:46:06 2008 +0000
@@ -90,5 +90,7 @@ VTPM_TOOLS ?= n
VTPM_TOOLS ?= n
LIBXENAPI_BINDINGS ?= n
PYTHON_TOOLS ?= y
+CONFIG_MINITERM ?= n
+CONFIG_LOMOUNT ?= n
-include $(XEN_ROOT)/.config
diff -r 2491691e3e69 tools/misc/Makefile
--- a/tools/misc/Makefile Sat Dec 29 17:57:47 2007 +0000
+++ b/tools/misc/Makefile Wed Jan 16 16:51:13 2008 +0000
@@ -13,6 +13,10 @@ TARGETS-$(CONFIG_X86) += xen-detect
TARGETS-$(CONFIG_X86) += xen-detect
TARGETS := $(TARGETS-y)
+SUBDIRS-$(CONFIG_LOMOUNT) += lomount
+SUBDIRS-$(CONFIG_MINITERM) += miniterm
+SUBDIRS := $(SUBDIRS-y)
+
INSTALL_BIN = $(TARGETS) xencons
INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview
@@ -21,8 +25,7 @@ all: build
.PHONY: build
build: $(TARGETS)
- $(MAKE) -C miniterm
- $(MAKE) -C lomount
+ set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
.PHONY: install
install: build
@@ -30,15 +33,12 @@ install: build
[ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin
$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
$(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
- $(MAKE) -C lomount install
-# No sense in installing miniterm on the Xen box.
-# $(MAKE) -C miniterm install
+ set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
.PHONY: clean
clean:
$(RM) *.o $(TARGETS) *~
- $(MAKE) -C miniterm clean
- $(MAKE) -C lomount clean
+ set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
%.o: %.c $(HDRS) Makefile
$(CC) -c $(CFLAGS) -o $@ $<
diff -r 2491691e3e69 tools/misc/lomount/Makefile
--- a/tools/misc/lomount/Makefile Sat Dec 29 17:57:47 2007 +0000
+++ b/tools/misc/lomount/Makefile Wed Jan 16 16:46:06 2008 +0000
@@ -15,7 +15,7 @@ build: $(BIN)
build: $(BIN)
.PHONY: install
-install: build
+install install-recurse: build
$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
.PHONY: clean
diff -r 2491691e3e69 tools/misc/miniterm/Makefile
--- a/tools/misc/miniterm/Makefile Sat Dec 29 17:57:47 2007 +0000
+++ b/tools/misc/miniterm/Makefile Wed Jan 16 16:46:06 2008 +0000
@@ -11,6 +11,9 @@ install: all
[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
$(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin
+.PHONY: install-recurse
+ : No sense in installing miniterm on the Xen box.
+
.PHONY: clean
clean:
$(RM) *.o $(TARGET) *~
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] disable lomount and miniterm by default
2008-01-16 17:01 [PATCH] disable lomount and miniterm by default Ian Jackson
@ 2008-01-16 17:11 ` Daniel P. Berrange
2008-01-17 16:12 ` Ian Jackson
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrange @ 2008-01-16 17:11 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Wed, Jan 16, 2008 at 05:01:32PM +0000, Ian Jackson wrote:
Content-Description: message body text
> lomount is a tool which reads and parses a partition table in a disk
> image block device and then uses mount -o ...offset=... to mount it.
> This is not an ideal approach. For example, if the intended
> filesystem has corrupted metadata the kernel's filesystem driver may
> start to write outside of the intended region. This might even be
> exploitable in some perverse circumstances.
>
> Nowadays people wanting to do this should use kpartx, which uses
> devmapper to create appropriate range mappings. So lomount should be
> disabled.
+1 for this.
> miniterm may well be useful but it is a clone-and-hack of an upstream
> project and is currently built but not installed by default, partly
> because it doesn't make sense to install on the dom0 which it might be
> trying to debug.
Any idea of what the changes are wrt to upstream ? If they're useful
we should try and get them upstream.
While on the subject of tools, I'm puzelled why Xen has created custom tools
qcow-create, qcow2raw and img2qcow, when they are less functional than
the existing 'qemu-img' tool that comes as part of the QEMU codebase
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] disable lomount and miniterm by default
2008-01-16 17:11 ` Daniel P. Berrange
@ 2008-01-17 16:12 ` Ian Jackson
0 siblings, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2008-01-17 16:12 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: xen-devel
Daniel P. Berrange writes ("Re: [Xen-devel] [PATCH] disable lomount and miniterm by default"):
> On Wed, Jan 16, 2008 at 05:01:32PM +0000, Ian Jackson wrote:
> > miniterm may well be useful but it is a clone-and-hack of an upstream
> > project and is currently built but not installed by default, partly
> > because it doesn't make sense to install on the dom0 which it might be
> > trying to debug.
>
> Any idea of what the changes are wrt to upstream ? If they're useful
> we should try and get them upstream.
The original author wrote it as example code for a book, rather than
as a software project which might be generally distributed and
updated. The internet seems full of a huge variety of clone-and-hack
copies of miniterm as a result.
> While on the subject of tools, I'm puzelled why Xen has created custom tools
> qcow-create, qcow2raw and img2qcow, when they are less functional than
> the existing 'qemu-img' tool that comes as part of the QEMU codebase
I'm afraid this is far from clear. If no-one knows why then we should
arrange to build qemu-img and and replace the references, so we can
deprecate our own less-sane tools.
Ian.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-17 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-16 17:01 [PATCH] disable lomount and miniterm by default Ian Jackson
2008-01-16 17:11 ` Daniel P. Berrange
2008-01-17 16:12 ` Ian Jackson
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.