VYPR
Unrated severityNVD Advisory· Published Feb 22, 2011· Updated Apr 29, 2026

CVE-2011-0530

CVE-2011-0530

Description

Buffer overflow in the mainloop function in nbd-server.c in the server in Network Block Device (nbd) before 2.9.20 might allow remote attackers to execute arbitrary code via a long request. NOTE: this issue exists because of a CVE-2005-3534 regression.

Affected products

20
  • Wouter Verhelst/Nbd20 versions
    cpe:2.3:a:wouter_verhelst:nbd:*:*:*:*:*:*:*:*+ 19 more
    • cpe:2.3:a:wouter_verhelst:nbd:*:*:*:*:*:*:*:*range: <=2.9.19
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.0:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.1:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.2:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.3:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.4:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.5:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.6:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.7:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.8:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.9:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.10:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.11:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.12:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.13:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.14:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.15:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.16:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.17:*:*:*:*:*:*:*
    • cpe:2.3:a:wouter_verhelst:nbd:2.9.18:*:*:*:*:*:*:*

Patches

1
3ef52043861a

Fix buffer size checking

https://github.com/yoe/nbdWouter VerhelstJan 27, 2011via nvd-ref
1 file changed · +2 2
  • nbd-server.c+2 2 modified
    @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
     #define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
     #define LINELEN 256	  /**< Size of static buffer used to read the
     			       authorization file (yuck) */
    -#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
    +#define BUFSIZE ((1024*1024)+sizeof(struct nbd_reply)) /**< Size of buffer that can hold requests */
     #define DIFFPAGESIZE 4096 /**< diff file uses those chunks */
     #define F_READONLY 1      /**< flag to tell us a file is readonly */
     #define F_MULTIFILE 2	  /**< flag to tell us a file is exported using -m */
    @@ -1389,7 +1389,7 @@ int mainloop(CLIENT *client) {
     
     		if (request.magic != htonl(NBD_REQUEST_MAGIC))
     			err("Not enough magic.");
    -		if (len > BUFSIZE + sizeof(struct nbd_reply))
    +		if (len > BUFSIZE - sizeof(struct nbd_reply))
     			err("Request too big!");
     #ifdef DODBG
     		printf("%s from %llu (%llu) len %d, ", request.type ? "WRITE" :
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

17

News mentions

0

No linked articles in our index yet.